Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Passing messages between apps: PBPro 1.063, STYX & BluGUI

Author
Message
Vidiot
18
Years of Service
User Offline
Joined: 15th May 2006
Location: TN
Posted: 22nd Apr 2007 23:11
I'm trying to learn how to pass messages between 2 apps on the same system. The main app is displaying images constantly. The second app in runningn in the background is perodically checking for updates and moving content. The second app has to be able to either (a) shut down the first porgram and relaunch it or (b) pass a message to the first program that it can respond to and then exit.

I'm trying to use the windows commands from the styx add-on but with no luck whatsoever. After issuing make app message and post app message, query app messages continues to equal zero.

This code represents the first app. Its just sitting there waiting for query app meggages to equal anything other than zero:



Here's the second program, makking a message and then posting it. According to the doc, its supposed to post to all programs, even itself, but if I do the query app messages even from this program, the value remains zero.



Tell me if you can, what am I doing wrong... OR of you know a better way to pass messages between apps, let me know. Since the finished app is for digital signage and will run continuously, I don't want it to be polling the hard drive constantly; otherwise, I would just leave a file on the drive that said,"hey, its time to shut down".
Vidiot
18
Years of Service
User Offline
Joined: 15th May 2006
Location: TN
Posted: 24th Apr 2007 05:43
Sure Vidiot, I'll help you solve that. I've no idea why the "Query App messages" just floated in the bowl causing you to bang your head up against the wall for several hours leaving a nasty bruise, but why not try the ol' windows clipboard function?

In the first program, you can write a string to the clipboard with the simple command WRITE TO CLIPBOARD "yo there". Then the second program can loop while GET CLIPBOARD$()="". As soon as the clipboard does equal something, you'll know about it. You can even have the second program reply back so than the first knows the message was received.
Vidiot
18
Years of Service
User Offline
Joined: 15th May 2006
Location: TN
Posted: 24th Apr 2007 05:45
Gee thanks Vidiot! That will work just fine.

Sure is a good thing no one wrote 37 posts arguing about the solution to this!

Login to post a reply

Server time is: 2024-11-25 19:49:25
Your offset time is: 2024-11-25 19:49:25