Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 01/15/20 in all areas

  1. Sherlock

    In-App Clipboard

    Fellas, please. If Attila thinks he gave enough information, you have two options: Either write an answer based on that, or don't write at all. This should please not escalate.
  2. Anders Melander

    In-App Clipboard

    I don't think anyone has a clue what you are talking about.
  3. I can't really comment on the multicast issue, especially on Android. But if you are really doing multicasting, why are you using TIdUDPServer? That is not a multicast-enabled component. Indy has separate TIdIPMCastClient and TIdIPMCastServer components specifically for multicast. For UDP, assuming a plain vanilla network broadcast is in fact, being used, are you setting up the TIdUDPServer.Bindings collection at all prior to activating the server? One problem I do see is your use of TThread.Queue() captures the ABinding object, which is no longer valid once the TIdUDPServer is freed. Delphi anonymous procedures capture variables, not values. You should use TThread.Queue() more like this instead: procedure TForm3.QueueLog(const AMsg: string); begin TThread.Queue(nil, procedure begin Log(AMsg); end ); end; procedure TForm3.QueueTestConnection(const APeerIP: string); begin TThread.Queue(nil, procedure begin TestConnection(APeerIP); end ); end; procedure TForm3.IdUDPServer1UDPRead(AThread: TIdUDPListenerThread; const AData: TIdBytes; ABinding: TIdSocketHandle); var Data: string; begin Data := TEncoding.Default.GetString(AData); QueueLog('Incoming broadcast message from: ' + ABinding.PeerIP); if SameText(Data, 'mytriggerphrase') then begin QueueTestConnection(ABinding.PeerIP); end; end;
  4. FredS

    What's the best common folder for...

    Stefan covered that under 'for the program itself ', don't clutter up Documents with stuff that isn't for the user's end use.. annoying 🙂
  5. Indeed, it is! The references are resolved in TReader.FixupReferences and are based on component names. To wire the datasource on the datamodule to the controls on the form, the datamodule has to be created before the form loads. As all forms and datamodules register themselves in the Screen.Forms and Screen.Datamodules lists, they are found by simply iterating over these lists in the Vcl.Forms.FindGlobalComponent procedure, which is registered via RegisterFindGlobalComponentProc. You can register your own FindGlobalComponentProc this way, which takes precedence over the internal one (System.Classes.FindGlobalComponents uses a reverse loop). The implementation might be a bit tricky, though.
×