× Discussions for CodeTyphon Object Pascal Programming Language

Question UniqueInstance problem

  • Premysl Beran
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
4 years 3 months ago #9526 by Premysl Beran
UniqueInstance problem was created by Premysl Beran
Hi everybody,
when I recently went for CT 5.7 I realized that my UniqueInstance doesn't work properly. I use this component to keep only one instance of my app and pass the relative parameters to existing one. In version CT 5.5 it worked fine. Then when I moved to CT 5.7 it just doesn't work. I still have only one instance of my app but the parameters are not pass through. The message is sent but not captured. I had already the same problem when using CT 4.9. The problem then disappears in CT 5.0.

I prepared small example to show the problem. Mainapp is the first to launch and then with button try to launch the secondapp. For the first time, the app is launched well with parameters. But if you try to launch it for the second time then the parameter is not pass through.

Thanks for help.

With best regards

Premek
Attachments:

Please Log in or Create an account to join the conversation.

  • Fred
  • Visitor
  • Visitor
4 years 3 months ago #9527 by Fred
Replied by Fred on topic UniqueInstance problem
Hello.

You may use also runonce_postit

Tested on Windows32/64, Linux32/64 and FreeBSD32/64.
With examples included for LCL, fpGUI and MSEgui.

Fre;D

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
4 years 3 months ago #9528 by Sternas Stefanos
Replied by Sternas Stefanos on topic UniqueInstance problem
Thanks Sir
we will try to fix this

PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

  • Premysl Beran
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
4 years 3 months ago #9529 by Premysl Beran
Replied by Premysl Beran on topic UniqueInstance problem
Thank you for the help. I'm looking forward to this fix.
Regards
Premek

Please Log in or Create an account to join the conversation.

  • Avra
  • Visitor
  • Visitor
4 years 2 months ago #9542 by Avra
Replied by Avra on topic UniqueInstance problem

Fred wrote: You may use also runonce_postit

Does it stop multiple instances under terminal services on Windows server?

Please Log in or Create an account to join the conversation.

  • Fred
  • Visitor
  • Visitor
4 years 2 months ago - 4 years 2 months ago #9549 by Fred
Replied by Fred on topic UniqueInstance problem

Does it stop multiple instances under terminal services on Windows server?


Huh, I never try but I do not see why it should not work... :blush:

Maybe you may try it, there are demos included (fpGUI and MSEgui demos are, in fact, console applications) ;)

Fre;D
Last edit: 4 years 2 months ago by Fred.

Please Log in or Create an account to join the conversation.

  • Premysl Beran
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
4 years 1 week ago #9807 by Premysl Beran
Replied by Premysl Beran on topic UniqueInstance problem
I tested runonce_postit several times but I don't like it. It use files in temp directory to pass the parameters. TUniqueInstance is very nice because it use Server on main application and send the messages from launched app.
Unfortunately I tested just released CT5.8 and there my problem still persist. The version where TUniqeInstance still works is CT5.5.
Hope that the problem will be solved in future.
Thanks for your hard work.
Premek

Please Log in or Create an account to join the conversation.

More
4 years 1 week ago #9808 by xcod

Please Log in or Create an account to join the conversation.

  • Fred
  • Visitor
  • Visitor
4 years 5 days ago #9821 by Fred
Replied by Fred on topic UniqueInstance problem

Premysl Beran wrote: I tested runonce_postit several times but I don't like it. It use files in temp directory to pass the parameters.
...
Premek


Hello.
The temp directory is needed only for the "postit" part of the code.
If you want only to run one instance, you only need the "runonce" part of the code that does not use any temporally file.

Fre;D

Please Log in or Create an account to join the conversation.