By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,386 Members | 1,705 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,386 IT Pros & Developers. It's quick & easy.

launch program vc++.net

P: n/a
How to launch a exe in a vc++ 2002 program?
What is the equivalent of vb6's app.path?
How can i get the exe name?
Thanks
davide
Dec 5 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
To run an app, look at ShellExecute
To get the path of the running executable, see GetModuleFileName

--
Regards,
Nish [VC++ MVP]
"DavideR" <Da*****@discussions.microsoft.com> wrote in message
news:77**********************************@microsof t.com...
How to launch a exe in a vc++ 2002 program?
What is the equivalent of vb6's app.path?
How can i get the exe name?
Thanks
davide

Dec 5 '05 #2

P: n/a
Thanks for reply
I'm using Vs2002 .net framvwork sp3
Really I need to rerun my exe
(in shellexecute i had compiling problem so
viewing helps
I use that:
PROCESS_INFORMATION pi;
STARTUPINFO si;
memset( &pi, 0, sizeof(PROCESS_INFORMATION) );
memset(&si, 0, sizeof(STARTUPINFO));
si.cb= sizeof(STARTUPINFO);
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_SHOWNA ;
si.lpDesktop = "";
CreateProcess( NULL,
Assembly::GetExecutingAssembly()->Location,
NULL,
NULL,
FALSE,
NORMAL_PRIORITY_CLASS,
NULL,
NULL,
&si,
&pi );
and i receive the following error
unable to convert parameter 2 from system::string__gc* to LPSTR
If i Put in the second parameter (char*))"progpath and name" all works!!
If i run
Console::writeline(S"location{0{ =
",Assembly::GetExecutingAssembly()->Location
I view the correct path
That's a conversion Problem i thing but i don't Know how to solve
thanks best
regards
"Nishant Sivakumar" wrote:
To run an app, look at ShellExecute
To get the path of the running executable, see GetModuleFileName

--
Regards,
Nish [VC++ MVP]
"DavideR" <Da*****@discussions.microsoft.com> wrote in message
news:77**********************************@microsof t.com...
How to launch a exe in a vc++ 2002 program?
What is the equivalent of vb6's app.path?
How can i get the exe name?
Thanks
davide


Dec 6 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.