Getting the version number of a *.dll

For questions and postings not covered by the other forums
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Getting the version number of a *.dll

Postby ConvertFromOldNGs » Fri Aug 07, 2009 11:54 am

by Jens Richnow >> Wed, 10 May 2000 0:15:50 GMT

I need to determine teh version number of a *.dll we are using in a project. I had a look in the SDK platform and at some samples written in C++ and VFoxPro. However ... no matter how often I start from a
different angle I'm always stuck at the point when it comes to define pointers and types. In the end I would like to use the DllGetVersion callback function imlemented in most dll's.

Does anybody has experiences with determining the version numbers of dll's and could give some advice?

Cheers,

Jens

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Getting the version number of a *.dll

Postby ConvertFromOldNGs » Fri Aug 07, 2009 11:54 am

by Krull >> Wed, 10 May 2000 1:17:50 GMT

Hi Jens,

Are you trying to do this directly in JADE using external function calls or are you planning on providing a wrapper function? The problem with calling DllGetVersion from an arbitrary dll directly from JADE is that it is a 3) step process.

1) hinst = LoadLibrary(modulename)
2) <function pointer> = GetProcAddress(hinst, "DllGetVersion")
3) call <function pointer>

Now, allthough you can do steps 1 and 2 in JADE, step 3 will be be somewhat tricky.

One way to do this is to provide a C/C++ wrapper function that returns the version as a string, an integer or an integer for each field, then call the wrapper from JADE. If its of any use to you, I can provide a sample C++ class that looks for DLL version info in 3 possible places in order of: 1) DllGetVersion
2) Fixed File version info
3) String File version Info

This looks in 3 places because only newer DLLs export a DllGetVersion entry-point (all JADE DLLs do when they are built correctly) and other 3rd party DLLs have String version info but not fixed version info.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 23 guests