Welcome, Guest
Username: Password: Remember me
Discussions for CodeTyphon Object Pascal Programming Language
  • Page:
  • 1

TOPIC:

UniqueInstance problem 8 years 6 months ago #9526

  • Premysl Beran
  • Premysl Beran's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 52
  • Thank you received: 0
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.

UniqueInstance problem 8 years 6 months ago #9527

  • Fred
  • Fred's Avatar
  • Visitor
  • Visitor
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.

UniqueInstance problem 8 years 6 months ago #9528

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4535
  • Thank you received: 1114
Thanks Sir
we will try to fix this
PilotLogic Architect and Core Programmer

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

UniqueInstance problem 8 years 6 months ago #9529

  • Premysl Beran
  • Premysl Beran's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 52
  • Thank you received: 0
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.

UniqueInstance problem 8 years 6 months ago #9542

  • Avra
  • Avra's Avatar
  • Visitor
  • Visitor

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.

UniqueInstance problem 8 years 6 months ago #9549

  • Fred
  • Fred's Avatar
  • Visitor
  • Visitor

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

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

Last edit: by Fred.

UniqueInstance problem 8 years 3 months ago #9807

  • Premysl Beran
  • Premysl Beran's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 52
  • Thank you received: 0
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.

UniqueInstance problem 8 years 3 months ago #9808

  • xcod
  • xcod's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 45
  • Thank you received: 2

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

UniqueInstance problem 8 years 3 months ago #9821

  • Fred
  • Fred's Avatar
  • Visitor
  • Visitor

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.

  • Page:
  • 1