Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CreateProcess - quick question

Status
Not open for further replies.

Bobofbobland

Programmer
Mar 28, 2003
8
0
0
GB
Hi,

I'm doing a rapid dll (for this afternoon) in Visual C++. Backgound is UNIX!

I'm trying to start another application from a dll that plugs into another app again.

I'm using CreateProcess which works with an absolute path name. Unfortunately the location of the .exe is relative to the application that is using the dll.

Absolute path name would be fine. It won't be across the network, but how do I get this. As soon as I know then I can go and get my lunch.

Any help appreciated.

-Bo'B
 
* GetModulePathName to obtain your DLL's pathname
* use string functions to remove characters to the right of the last [tt]'\\'[/tt]
* PathCombine to append to your module's path something like [tt]"..\\Directory\\Other.exe"[/tt]
 
The approach is ok, only GetModulePathName should be GetModuleFileName...
Greetings,
Rick
 
Sorry I was away from my MSDN Library just relying on memory.
 
Thanks alot!

Actually, I'd found the GetModuleFileName call after some Googling. And the it only took me another hour to write the string handling. ;)

CHeers anyway. I'm going to go crawling back to Unix now!

(You are in a maze of twisty little API calls. They are all alike...)
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top