|
-
Apr 19th, 2001, 10:31 AM
#1
Thread Starter
New Member
I have a game application which is played via email. Upon opening a newly received data file from e-mail, players click on the data file to open or restore the program. My program starts, finds an already open instance (if any) of the program, and sends the full path (in the temp dir) of the newly received data file to the existing instance, then closes. I know all about App.PrevInstance, and I have no problem restoring the open instance. I am currently sending the path of the file to open via DDE, and that's where my trouble is. The DDE link fails to establish about 1 time out of 20, and I have had a very hard time trying to debug this, due to the need for email to be open and TWO instances of my VB program. I am logging all the DDE steps, but when it fails, it just seems to go off to "la-la land" (i.e. no errors, nothing logged, and the NEW - sending - instance of the app gets hung) when I try to set the LinkMode to 2.
Recently I realized that there MUST be an easier and faster way to do this, and that DDE probably isn't even necessary since I don't need a 2-way conversation! I'm thinking that I should be able to use something like "SendMessage" to transmit the newly-received path the already-open instance. My program already has a WindowProc procedure in it (I'm using the System Tray snippet), so I think I have a way to "catch" the message as well.
Basically, what I need is this:
1. Given that I know the window handle of the existing instance, how do I send a string (the path) to it?
2. When that message is sent, how do I go about getting the existing instance to recognize that it has been sent a message, so that I can act upon it?
THANK YOU FOR ANY HELP!!
Wayne Torman
Please email me at: [email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|