User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Mar 2004
Posts: 218
Reputation: BountyX is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 7
BountyX's Avatar
BountyX BountyX is offline Offline
Code Guru

Another Program Launching mine

  #1  
May 23rd, 2004
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?
A Hacker's Mind:
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2004
Posts: 250
Reputation: FireNet will become famous soon enough FireNet will become famous soon enough 
Rep Power: 6
Solved Threads: 6
FireNet's Avatar
FireNet FireNet is offline Offline
Posting Whiz in Training

Re: Another Program Launching mine

  #2  
May 24th, 2004
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.
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
See what you can, remember what you need

Fourzon | Earn via Coding
Reply With Quote  
Join Date: May 2004
Posts: 53
Reputation: Natso is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 1
Natso Natso is offline Offline
Junior Poster in Training

Re: Another Program Launching mine

  #3  
May 24th, 2004
couldn't you just have the installer create a txt or dat file at 'c:\proglocate.dat' that has the path to the program in it? then when running the program just open proglocate.dat & run the correct file.
Reply With Quote  
Join Date: May 2004
Posts: 250
Reputation: FireNet will become famous soon enough FireNet will become famous soon enough 
Rep Power: 6
Solved Threads: 6
FireNet's Avatar
FireNet FireNet is offline Offline
Posting Whiz in Training

Re: Another Program Launching mine

  #4  
May 25th, 2004
Are you using ShellExecute() ??
See what you can, remember what you need

Fourzon | Earn via Coding
Reply With Quote  
Join Date: Mar 2004
Posts: 218
Reputation: BountyX is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 7
BountyX's Avatar
BountyX BountyX is offline Offline
Code Guru

Re: Another Program Launching mine

  #5  
May 26th, 2004
Originally Posted by FireNet
Are you using ShellExecute() ??
Found the solution:
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
Reply With Quote  
Join Date: May 2004
Posts: 250
Reputation: FireNet will become famous soon enough FireNet will become famous soon enough 
Rep Power: 6
Solved Threads: 6
FireNet's Avatar
FireNet FireNet is offline Offline
Posting Whiz in Training

Re: Another Program Launching mine

  #6  
May 27th, 2004
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 ??
See what you can, remember what you need

Fourzon | Earn via Coding
Reply With Quote  
Join Date: Mar 2004
Posts: 218
Reputation: BountyX is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 7
BountyX's Avatar
BountyX BountyX is offline Offline
Code Guru

Re: Another Program Launching mine

  #7  
Sep 20th, 2004
bah I got it fixed, no worries.
A Hacker's Mind:
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
Reply With Quote  
Join Date: Dec 2003
Location: Nashville, TN
Posts: 2,333
Reputation: alc6379 has a spectacular aura about alc6379 has a spectacular aura about alc6379 has a spectacular aura about 
Rep Power: 11
Solved Threads: 101
Colleague
alc6379's Avatar
alc6379 alc6379 is offline Offline
Cookie... That's it

Re: Another Program Launching mine

  #8  
Sep 20th, 2004
Originally Posted by BountyX
bah I got it fixed, no worries.

What'd you end up doing?

I know this isn't something that would concern me too much, but for posterity, perhaps others would like to know. Besides, it would let us mark the thread as "solved"
Alex Cavnar, aka alc6379
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb C++ Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the C++ Forum

All times are GMT -4. The time now is 12:17 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC