Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

10 Good

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. with MyDataSet do begin FieldByName('aaa').AsString := 'abcd'; FieldByName('bbb').AsInteger := 234; etc... end; This ca reduce typing.
  2. Thanks FredS, after I add "With Self do" in my helper class, it can access provate field in another unit. in unit1, here is TMyClassB: TMyClassB = class private FMyClassA: TMyClassA; function GetMyName: string; public constructor Create; property MyName: string read GetMyName; end; in Unit2, here is my helper class: TMyClassB3 = class helper for TMyClassB public constructor Create(B: Boolean); overload; end; constructor TMyClassB3.Create(B: Boolean); begin //if B then FMyClassA := TMyClassA2.Create; //helper class can not access private field. //use with self do, here can access private field with Self do begin FMyClassA := TMyClassA2.Create; end; end;
  3. My test code as: constructor TMyClassB3.Create(B: Boolean); begin if B then FMyClassA := TMyClassA2.Create; end; The field "FMyClassA" is declared in TMyClassB2 in another unit, and this code can not compile. because field "FMyClassA" is a private field of TMyClassB2.
  4. I have done a test if the class helper is in a different unit with the original class, it can not access private field in original class.
  5. Thank you Fred. I will try helper class mode.
  6. Yes, this is why I do not want to copy it and modify it, I just want to inherit a new class in a new unit, to avoid modify Delphi's source file.
  7. In unit Soap.SOAPLinked.pas there are: 1. TLinkedWebNode 2. TLogLinkedWebNode = class(TLinkedWebNode) 3. TLinkedRIO = class(TRIO) in TLinkedRIO, it has two constructor: one is for: FLinkedWebNode := TLinkedWebNode.Create(nil); and another is for: FLinkedWebNode := TLogLinkedWebNode.Create(nil); My question is: if I want to create a new TLinkedWebNode like TLogLinkedWebNode, Just named it TMyWebNode, I must let TLinkedRIO has a new constructor that lets it create FLinkedWebNode as my new TMyWebNode. but, I can not modify Soap.SOAPLinked.pas because it is source code in Delphi. I will create a new pas file and inherit TLinkedRIO like TMyRIO = class(TLinkedRIO) and add a new constructor in it. but, the new TMyRIO in a new pas unit, I can not access FLinkedWebNode like FLinkedWebNode := TMyWebNode.Create(nil); So, is there any way to do that? or this is a design issue in Soap.SOAPLinked.pas and I must modify it?
  8. pcplayer99

    Drone control from mobile

    I have made a drone controller APP years ago. It was made by Firemonkey, through WiFi to communication with a WiFi camera, play real time video stream from camera on the drone, and send control command to camera and the camera forward this command to drone controller through UART.
  9. pcplayer99

    Soap Server and client downloading files

    Hi, here is my demo project: https://github.com/pcplayer/WebServiceUploadFile
  10. pcplayer99

    best component for web media player

    [Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.] According to the above statement, it just supports draw the image to the screen, there is no decoder in it. To using DirectShow, there is H.264 decoder you can use. There is an open-source decoder for DirectShow named FFDShow.
  11. pcplayer99

    best component for web media player

    [SDL is written in C, works natively with C++, and there are bindings available for several other languages, including C# and Python.] So, I do not know if it is can be used in Delphi. I have updated Dspack to let it can compile in higher version Delphi, so, it is still can be used in the new version of Delphi. Here is my updated version: https://github.com/pcplayer/Dspack In Windows, DirectShow still exists, and if you using Delphi to play media, you still can using DirectShow. And Dspack is a set of open-source Delphi code for DirectShow.
  12. pcplayer99

    best component for web media player

    if you use VCL then your app will run under windows. So I suggest you should use Directshow to build your media-player. There is an open-source component named DSPACK for DirectShow.
  13. pcplayer99

    Soap Server and client downloading files

    Hi, These codes I have tested ok. Server Side: unit TestAttachImpl; interface uses Soap.InvokeRegistry, System.Types, System.SysUtils, Soap.XSBuiltIns, TestAttachIntf; type { TTestAttach } TTestAttach = class(TInvokableClass, ITestAttach) public procedure GetAttach(var FileName: string; out Attach: TSOAPAttachment); stdcall; procedure PutAttach(const FileName: string; Attach: TSOAPAttachment); stdcall; end; implementation { TTestAttach } procedure TTestAttach.GetAttach(var FileName: string; out Attach: TSOAPAttachment); var Fn: string; begin //Send file to client Fn := 'F:\H264Output.mp4'; Attach := TSOAPAttachment.Create; Attach.SetSourceFile(Fn); FileName := ExtractFileName(Fn); end; procedure TTestAttach.PutAttach(const FileName: string; Attach: TSOAPAttachment); begin //receive file that client upload Attach.SaveToFile(ExtractFilePath(GetModuleName(0)) + FileName); end; initialization { Invokable classes must be registered } InvRegistry.RegisterInvokableClass(TTestAttach); end. Client-side: procedure TForm2.Button1Click(Sender: TObject); var Attach: TSOAPAttachment; Intf: ITestAttach; Path, Fn: string; begin //client download file Path := ExtractFilePath(Application.ExeName); Attach := TSOAPAttachment.Create; Intf := HTTPRIO1 as ITestAttach; try Intf.GetAttach(Fn, Attach); Attach.SaveToFile(Path + Fn); finally Intf := nil; Attach.Free; end; end; procedure TForm2.Button2Click(Sender: TObject); var Fn: string; Attach: TSOAPAttachment; Intf: ITestAttach; begin //client upload file if OpenDialog1.Execute then begin Fn := OpenDialog1.FileName; Attach := TSOAPAttachment.Create; Attach.SetSourceFile(Fn); Intf := HTTPRIO1 as ITestAttach; try Intf.PutAttach(ExtractFileName(Fn), Attach); finally Intf := nil; Attach.Free; end; end; end;
  14. Hi, OK, you can not setup router. Then you must have a server on the Internet that your LAN APP and your Android APP can get connected. This is not about callbacks or other tech. This is about how tow to establish communication between two device. Under normal conditions, to establish connection between two device, there must be a server, both device connect to this server, this server is working as a bridge.
  15. Your issue is: A server working in a LAN server which has a private IP address, and your client want to access from Internet. If your LAN has a Internet router, and if you can setup the port mapping of this router, then your client can access your server from Internet. This is a simple diagram of port mapping: Internet -- xx.xx.xx.xx(Your router's public IP address) --- (port 8888: -- this is the port mapping setup in your router) --- Your Server on If your router's public IP address is dynamic, you will using some dynamic DNS services to let a fixed DNS name point to your dynamic IP address.