-
April 9th, 2010, 01:19 AM
#1
Application open at window startup but showing the wrong path
Hi all ,
My application is installed properly and open on start up.When I checked the current opened application path by using the GetCurrentDirectory() Method it showing "C:\Documents and Settings\Administrator" but the original application had stored at "C:\program files\App\App.exe"
Because of this, start up application does find dynamic Dll file which had been stored at "C:\program files\App\App.dll" and my application get crashed because it doesn't find tha App.dll at correct path.
Can anybody tell me when application open at startup why it's showing the path "C:\Documents and Settings\Administrator" instead of "C:\program files\App".
And what could be the desired solutions for this problem.
Thanks in advance..
thanks,
rohit
-
April 9th, 2010, 02:31 AM
#2
Re: Application open at window startup but showing the wrong path
Don't use GetCurrentDirectory.
Use GetModuleFileName to obtain the full path and file name of your exe and zhen extract to path part from it.
Victor Nijegorodov
-
April 9th, 2010, 02:49 AM
#3
Re: Application open at window startup but showing the wrong path
thanks for reply, it worked.
-
April 9th, 2010, 07:10 AM
#4
Re: Application open at window startup but showing the wrong path
You could have found the answer by looking at our FAQ:
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|