Opening up an application from VB
You can use ShellExecute if you know the name of a data file used by that
program. Windows will automatically load the program with that data file.
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
"Rebecca Henihan" <henihan@iol.ie> wrote in message
news:38ce9b1b$1@news.dev-archive.com...
>
> Hi there,
>
> If you do not know the path to an .exe on a users machine, how do you find
> it out?
>
> I am in the process of completing an application which views Architectural
> drawings using VB6.0. My problem is that I have to allow users the option
> to select a drawing name from a treeview node in my application and then
> let them click a "Link To AutoCAD" button. The purpose of which is to
open
> up AutoCAD and show the particular drawing. This is all very well and
good
> if I know the version of AutoCAD that they are using and the path of the
> AutoCAD executable (I can use the Shell Function).
>
> However, my problem is that I do not know the path to the AutoCAD exe or
> the version. I want my program to be able to automatically open up a
program
> to view the drawings and very simply I do not know how to do this. I know
> that Windows will open up a file if double clicked with the appropriate
program
> i.e. a .doc file will be opened in Word, etc. Is there a way for me to do
> this from my program?
>
> I have been looking at various API calls, but I am confused as to which
one
> to use and how!
>
>
> Cheers,
> Rebecca
>
# 1 Re: Opening up an application from VB
You can use ShellExecute if you know the name of a data file used by that
program. Windows will automatically load the program with that data file.
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
"Rebecca Henihan" <henihan@iol.ie> wrote in message
news:38ce9b1b$1@news.dev-archive.com...
>
> Hi there,
>
> If you do not know the path to an .exe on a users machine, how do you find
> it out?
>
> I am in the process of completing an application which views Architectural
> drawings using VB6.0. My problem is that I have to allow users the option
> to select a drawing name from a treeview node in my application and then
> let them click a "Link To AutoCAD" button. The purpose of which is to
open
> up AutoCAD and show the particular drawing. This is all very well and
good
> if I know the version of AutoCAD that they are using and the path of the
> AutoCAD executable (I can use the Shell Function).
>
> However, my problem is that I do not know the path to the AutoCAD exe or
> the version. I want my program to be able to automatically open up a
program
> to view the drawings and very simply I do not know how to do this. I know
> that Windows will open up a file if double clicked with the appropriate
program
> i.e. a .doc file will be opened in Word, etc. Is there a way for me to do
> this from my program?
>
> I have been looking at various API calls, but I am confused as to which
one
> to use and how!
>
>
> Cheers,
> Rebecca
>
# 2 Re: Opening up an application from VB
Hi there,
If you do not know the path to an .exe on a users machine, how do you find
it out?
I am in the process of completing an application which views Architectural
drawings using VB6.0. My problem is that I have to allow users the option
to select a drawing name from a treeview node in my application and then
let them click a "Link To AutoCAD" button. The purpose of which is to open
up AutoCAD and show the particular drawing. This is all very well and good
if I know the version of AutoCAD that they are using and the path of the
AutoCAD executable (I can use the Shell Function).
However, my problem is that I do not know the path to the AutoCAD exe or
the version. I want my program to be able to automatically open up a program
to view the drawings and very simply I do not know how to do this. I know
that Windows will open up a file if double clicked with the appropriate program
i.e. a .doc file will be opened in Word, etc. Is there a way for me to do
this from my program?
I have been looking at various API calls, but I am confused as to which one
to use and how!
Cheers,
Rebecca
# 3 Re: Opening up an application from VB
you can use FindExecutable to get the regestered executable path then use
ShellExecute as Jonathan suggested
"Jonathan Wood" <jwood@softcircuits.com> wrote:
>You can use ShellExecute if you know the name of a data file used by that
>program. Windows will automatically load the program with that data file.
>
>--
>Jonathan Wood
>SoftCircuits Programming
>http://www.softcircuits.com
>
>"Rebecca Henihan" <henihan@iol.ie> wrote in message
>news:38ce9b1b$1@news.dev-archive.com...
>>
>> Hi there,
>>
>> If you do not know the path to an .exe on a users machine, how do you
find
>> it out?
>>
>> I am in the process of completing an application which views Architectural
>> drawings using VB6.0. My problem is that I have to allow users the option
>> to select a drawing name from a treeview node in my application and then
>> let them click a "Link To AutoCAD" button. The purpose of which is to
>open
>> up AutoCAD and show the particular drawing. This is all very well and
>good
>> if I know the version of AutoCAD that they are using and the path of the
>> AutoCAD executable (I can use the Shell Function).
>>
>> However, my problem is that I do not know the path to the AutoCAD exe
or
>> the version. I want my program to be able to automatically open up a
>program
>> to view the drawings and very simply I do not know how to do this. I
know
>> that Windows will open up a file if double clicked with the appropriate
>program
>> i.e. a .doc file will be opened in Word, etc. Is there a way for me to
do
>> this from my program?
>>
>> I have been looking at various API calls, but I am confused as to which
>one
>> to use and how!
>>
>>
>> Cheers,
>> Rebecca
>>
>
>
# 4 Re: Opening up an application from VB
you can use FindExecutable to get the regestered executable path then use
ShellExecute as Jonathan suggested
"Jonathan Wood" <jwood@softcircuits.com> wrote:
>You can use ShellExecute if you know the name of a data file used by that
>program. Windows will automatically load the program with that data file.
>
>--
>Jonathan Wood
>SoftCircuits Programming
>http://www.softcircuits.com
>
>"Rebecca Henihan" <henihan@iol.ie> wrote in message
>news:38ce9b1b$1@news.dev-archive.com...
>>
>> Hi there,
>>
>> If you do not know the path to an .exe on a users machine, how do you
find
>> it out?
>>
>> I am in the process of completing an application which views Architectural
>> drawings using VB6.0. My problem is that I have to allow users the option
>> to select a drawing name from a treeview node in my application and then
>> let them click a "Link To AutoCAD" button. The purpose of which is to
>open
>> up AutoCAD and show the particular drawing. This is all very well and
>good
>> if I know the version of AutoCAD that they are using and the path of the
>> AutoCAD executable (I can use the Shell Function).
>>
>> However, my problem is that I do not know the path to the AutoCAD exe
or
>> the version. I want my program to be able to automatically open up a
>program
>> to view the drawings and very simply I do not know how to do this. I
know
>> that Windows will open up a file if double clicked with the appropriate
>program
>> i.e. a .doc file will be opened in Word, etc. Is there a way for me to
do
>> this from my program?
>>
>> I have been looking at various API calls, but I am confused as to which
>one
>> to use and how!
>>
>>
>> Cheers,
>> Rebecca
>>
>
>
# 5 Re: Opening up an application from VB
Dear Rebecca,
Some months ago I wrote a tip of the month that I call 'Launch a File Using
Its Associated Application'. Link to http://www.buygold.net/tips.html then
look for the February 2000 tip of the month. A sample program is provided.
Cheers,
Larry Rebich
larry@buygold.net
www.buygold.net
"Rebecca Henihan" <henihan@iol.ie> wrote in message
news:38ce9b1b$1@news.dev-archive.com...
>
> Hi there,
>
> If you do not know the path to an .exe on a users machine, how do you find
> it out?
>
> I am in the process of completing an application which views Architectural
> drawings using VB6.0. My problem is that I have to allow users the option
> to select a drawing name from a treeview node in my application and then
> let them click a "Link To AutoCAD" button. The purpose of which is to
open
> up AutoCAD and show the particular drawing. This is all very well and
good
> if I know the version of AutoCAD that they are using and the path of the
> AutoCAD executable (I can use the Shell Function).
>
> However, my problem is that I do not know the path to the AutoCAD exe or
> the version. I want my program to be able to automatically open up a
program
> to view the drawings and very simply I do not know how to do this. I know
> that Windows will open up a file if double clicked with the appropriate
program
> i.e. a .doc file will be opened in Word, etc. Is there a way for me to do
> this from my program?
>
> I have been looking at various API calls, but I am confused as to which
one
> to use and how!
>
>
> Cheers,
> Rebecca
>
# 6 Re: Opening up an application from VB
Dear Rebecca,
Some months ago I wrote a tip of the month that I call 'Launch a File Using
Its Associated Application'. Link to http://www.buygold.net/tips.html then
look for the February 2000 tip of the month. A sample program is provided.
Cheers,
Larry Rebich
larry@buygold.net
www.buygold.net
"Rebecca Henihan" <henihan@iol.ie> wrote in message
news:38ce9b1b$1@news.dev-archive.com...
>
> Hi there,
>
> If you do not know the path to an .exe on a users machine, how do you find
> it out?
>
> I am in the process of completing an application which views Architectural
> drawings using VB6.0. My problem is that I have to allow users the option
> to select a drawing name from a treeview node in my application and then
> let them click a "Link To AutoCAD" button. The purpose of which is to
open
> up AutoCAD and show the particular drawing. This is all very well and
good
> if I know the version of AutoCAD that they are using and the path of the
> AutoCAD executable (I can use the Shell Function).
>
> However, my problem is that I do not know the path to the AutoCAD exe or
> the version. I want my program to be able to automatically open up a
program
> to view the drawings and very simply I do not know how to do this. I know
> that Windows will open up a file if double clicked with the appropriate
program
> i.e. a .doc file will be opened in Word, etc. Is there a way for me to do
> this from my program?
>
> I have been looking at various API calls, but I am confused as to which
one
> to use and how!
>
>
> Cheers,
> Rebecca
>
