Show Bid Request
Path to DLL - Not AppPath
Bid Request Id: 20431
|
|
|
Posted by: |
ShoreSide (46 ratings)
(Software buyer rating 9.95)
|
Posted: |
Jul 1, 2002 4:12:21 PM EDT
|
Bidding Closes: |
Jul 15, 2002 4:14:54 PM EDT
|
Viewed (by coders): |
155 times
|
|
|
|
Description:
Hi, I have created a DLL - which is a plugin for another progam.
My Problem - Getting the DLL Path (from within the dll).
Assume the main program is located c:\someprogram\main.exe Assume that my dll is located c:\addons\mydll.dll
Now when main.exe triggers to call mydll.dll - mydll.dll looks for it's own path.
However - it keeps returning the path of the calling program (main.exe).
Need someone help me - what api do I need - for the dll - to find itself?
Please use a VB - API(only) Example.
Many of you are stating to use the GetModuleFileName Function - In this case - It will not work!
GetModuleFileName will only return the path to the Application that calling the dll!
What I want - is a function in the dll - to find it's own path. This should be relatively simple, but so far - everyone is stump! (accept for the registry) - which I tend to avoid - due to different windows versions!
Thanks
Deliverables: Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
Complete copyrights to all work purchased.
Platform:
Windows (all version)
Special Conditions / Other:
Need this ASAP! or (as soon as possible).
Thanks
Remember that contacting the other party outside of the site (by email, phone, etc.) on all business projects < $500 (before the buyer's money is escrowed) is a violation of both the software buyer and seller agreements.
We monitor all site activity for such violations and can instantly expel transgressers on the spot, so we thank you in advance for your cooperation.
If you notice a violation, you can report it to: abuse@rentacoder.com.
|
|
Bidding/Comments:
|
All monetary amounts on the site are in United States dollars.
Rent a Coder is a closed auction, so coders can only see their own bids and comments. Buyers can view every posting made on their bid requests. |
See all rejected bids (and all comments)
Name |
Bid Amount |
Date |
Coder Rating |
|
|
|
$50 (USD)
|
Jul 1, 2002 4:49:46 PM EDT
|
9.71
(Excellent)
|
|
|
Hello,
You just have to use Win32 API function GetModuleFileName
Regards, Sergei
|
|
|
|
This bid was accepted by the buyer!
|
$50 (USD)
|
Jul 1, 2002 5:07:51 PM EDT
|
9.71
(Excellent)
|
|
|
In more details :
hDLL = GetModuleHandle('mydll.dll')
GetModuleFileName(hDll, ...)
Or better save the hInstance of the MyDLL in the DllMain entry point (I'm not sure about how this can be done in VB) And then pass this hInstance to GetModuleFileName
Hope this will help
Regards, Sergei Regards, Sergei |
|
|
|
|
|