Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Obtaining DLL information from inside
Message
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00190002
Message ID:
00190225
Views:
12
>>I have a class that I compile into a DLL. From inside the class, I want a method that will return the verion number of the DLL that was set at build time. Getting the version number is easy using AGETFILEVERSION(). But, how do I get the name of the DLL?
>
>Hi Craig,
>
>I think Bela put you on the right path. Just to add my .02 (US), here's the code that should do the job:
>DECLARE INTEGER GetModuleHandle IN Win32API;
>    STRING @lpModuleName
>DECLARE INTEGER GetModuleFileName in Win32API;
>    INTEGER hModule, STRING @lpFilename,;
>    INTEGER nSize
>* Get the current module handle
>lnmodule = GetModuleHandle(0)
>lcfile = SPACE(260)
>lnresult = GetModuleFileName(lnmodule, @lcfile, 260)
>IF lnresult > 0
>  lcfile = LEFT(lcfile, lnresult)
>ENDIF
>That should do the trick for you.

Nope. Returns VFP6.EXE
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform