Re: Checking version of loaded OCX?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Gilles Ganault <nospam@xxxxxxxxxx> wrote:
On Fri, 3 Aug 2007 13:46:11 -0700, "Karl E. Peterson" <karl@xxxxxxxx>
wrote:
Nasty. Well, it's the latter, then. What part are you having trouble with?

I already have code that can go through a list of files on the hard
disk and extract version info from each, but this is not want I need
to do: Here, I need to check which version of an OCX is currently
loaded, to make sure it's the one that was shipped with my app instead
of some other version that the user installed through another
application.

The rough outline is something like:

OpenProcess
EnumProcessModules
GetModuleFileNameEx
CloseHandle

Yup, that looks like:
1. Somehow, in Main(), get a list of the OCX's that the VB needs to
work
2. For each file, find out which file + version Windows will load. I
guess I can use New + ProgID to try and load each file, get its full
path, and read its version info from the OCX

Dunno if you've got this going yet (been on vacation), but the "Somehow in Main"
would be called LoadLibrary. Force Windows to choose by not supplying a path, then
enumerate the loaded modules.
--
..NET: It's About Trust!
http://vfred.mvps.org


.



Relevant Pages