For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > February 2006 > Shell function









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Shell function
Jess

2006-02-28, 9:55 pm

Hi!

I have an application (powerpro) in which one instance of it is open all the
time. If I want to execute one of the files associated with this application
I only have to double click on one of them.

Since only one instance of this application can be running, I have a hard
time using the VB6 shell function. Every time I use shell to launch one the
files associated with this application, VB displays an error message telling
me that only one instance of my application can be running. Is there a way to
get around this? There should be a way because when I double click on one of
the files associated with this application, no new instances are created: the
file is loaded and executed. Can anybody post a sample?


Thanks in advance

Karl E. Peterson

2006-02-28, 9:55 pm

Jess wrote:
> Hi!
>
> I have an application (powerpro) in which one instance of it is open
> all the time. If I want to execute one of the files associated with
> this application I only have to double click on one of them.
>
> Since only one instance of this application can be running, I have a
> hard time using the VB6 shell function. Every time I use shell to
> launch one the files associated with this application, VB displays an
> error message telling me that only one instance of my application can
> be running. Is there a way to get around this? There should be a way
> because when I double click on one of the files associated with this
> application, no new instances are created: the file is loaded and
> executed. Can anybody post a sample?


Double-clicking the associated file (potentially) causes Windows to initiate
a DDE conversation with the application. You could try this yourself. To
get a better idea of the mechanics, from the POV of the other application,
take a look at this:

http://vb.mvps.org/samples/PrevInst

You can get the clues necessary there to dig through the registry and
determine the parameters needed for the DDE conversation, I think.
--
Working without a .NET?
http://classicvb.org/


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com