Recent

Author Topic: [SOLVED] UniqueInstance.OnOtherInstance not working anymore  (Read 2127 times)

Pascal

  • Hero Member
  • *****
  • Posts: 922
[SOLVED] UniqueInstance.OnOtherInstance not working anymore
« on: October 13, 2016, 01:29:23 pm »
UniqueInstance.OnOtherInstance is not working anymore.
The other instance recognizes then running instance and sends a message to it and quits.
But the running instance doesn't receives the message and therfore OnOtherInstance isn't invoked!

This had worked some time ago.

Any ideas?
« Last Edit: October 13, 2016, 04:13:53 pm by Pascal »
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (20H2)

varianus

  • New Member
  • *
  • Posts: 21
Re: UniqueInstance.OnOtherInstance not working anymore
« Reply #1 on: October 13, 2016, 03:19:50 pm »
If you are using Windows and FPC trunk, it could be related to changes on TSimpleIPC components.

Now TSimpleIPCServer does not check automatically for new messages (http://mantis.freepascal.org/view.php?id=30434)

As a workaround you could edit uniqueinstance.pas commenting out all the "unix" ifdefs, so under Windows it use the same timer stuff needed on Linux

For example:
Code: Pascal  [Select][+][-]
  1. //{$ifdef unix}        
  2.     procedure CheckMessage(Sender: TObject);           
  3. //{$endif}

And so on..

Pascal

  • Hero Member
  • *****
  • Posts: 922
[SOLVED] Re: UniqueInstance.OnOtherInstance not working anymore
« Reply #2 on: October 13, 2016, 04:13:24 pm »
Many thanks, that solved the issue!
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (20H2)

 

TinyPortal © 2005-2018