•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 392,079 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,018 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser:
Views: 2869 | Replies: 7
![]() |
Another Program needs to launch my program, but for some reason becuase its lauching it, my program looks for all the required dlls and program files with in the direcotry of the program launching it. I do not want this, and despertly need a fix, any suggestions?
Additionally, is their a way to find my program's location, regardless of which program is launching it and where it's launched from?
Additionally, is their a way to find my program's location, regardless of which program is launching it and where it's launched from?
A Hacker's Mind:
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
Now this is something which depends on you.If you want you can store all the dll in some specific folder and when the program is launced open those file with the absolute paths.
If your program is DOS the you can look in argv[0] for the full path.
eg.c:\sdd\path\yourprogram.exe is what is there.
yea there are some standard headers which provide funtions to splitup the path into various componets but if need them tell me and i will look it up
If your program is DOS the you can look in argv[0] for the full path.
eg.c:\sdd\path\yourprogram.exe is what is there.
int main(int arg,char **argv)
{
cout<<argv[0];
return 0;
}yea there are some standard headers which provide funtions to splitup the path into various componets but if need them tell me and i will look it up
•
•
•
•
Originally Posted by FireNet
Are you using ShellExecute() ??
GetModuleFileName() ;
First module is always the current process, includes path and various other details.
A Hacker's Mind:
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
•
•
•
•
Originally Posted by BountyX
Found the solution:
GetModuleFileName() ;
First module is always the current process, includes path and various other details.
What are the parameters or returns ??
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
Similar Threads
- Error message KERNEL32.DLL (Windows Software)
- Only 1 instance of program (Java)
Other Threads in the C++ Forum
- Previous Thread: i need help
- Next Thread: i need ur help



Linear Mode