Home All Groups Group Topic Archive Search About

Ocx : how to read MajorVer, MinorVer and RevisionVer ?

Author
29 Mar 2010 10:22 AM
Patrice Dargenton
Hello, I am looking for a trick to read the file version of an ocx in
dotnet, the file version that is showed in the file explorer : I want to be
sure that the version of the registered ocx is correct before continuing to
run a software which depends on the ocx. Does anyone has a solution ?
Thanks.

Example in the Windows file explorer :
File version : 2.0.0.16

VB6 ocx version :
MajorVer=2
MinorVer=0
RevisionVer=16

-------------------------------------------------------
Patrice Dargenton
patrice.dargen***@free.fr
http://patrice.dargenton.free.fr/index.html
-------------------------------------------------------

Author
29 Mar 2010 3:55 PM
Family Tree Mike
Show quote Hide quote
"Patrice Dargenton" wrote:

> Hello, I am looking for a trick to read the file version of an ocx in
> dotnet, the file version that is showed in the file explorer : I want to be
> sure that the version of the registered ocx is correct before continuing to
> run a software which depends on the ocx. Does anyone has a solution ?
> Thanks.
>
> Example in the Windows file explorer :
> File version : 2.0.0.16
>
> VB6 ocx version :
> MajorVer=2
> MinorVer=0
> RevisionVer=16
>
> -------------------------------------------------------
> Patrice Dargenton
> patrice.dargen***@free.fr
> http://patrice.dargenton.free.fr/index.html
> -------------------------------------------------------
>
>
>
> .
>

To get the version information on a file, use the FileVersionInfo class. 
The class documentation is available here:
http://msdn.microsoft.com/en-us/library/system.diagnostics.fileversioninfo.aspx

Mike
Author
30 Mar 2010 9:46 AM
Patrice Dargenton
Thank you very much !
I just have to read the path of the ocx registered in the registry :
[HKEY_CLASSES_ROOT\CLSID\{xxx}\InprocServer32]
via
[HKEY_CLASSES_ROOT\CLSID\{xxx}]
-------------------------------------------------------
Patrice Dargenton
patrice.dargen***@free.fr
http://patrice.dargenton.free.fr/index.html
-------------------------------------------------------

"Family Tree Mike" <FamilyTreeM***@discussions.microsoft.com> a écrit dans
le message de news: EEE4E5C4-F049-421D-A30F-A0D4D2E7D***@microsoft.com...
Show quoteHide quote
>
>
> "Patrice Dargenton" wrote:
>
>> Hello, I am looking for a trick to read the file version of an ocx in
>> dotnet, the file version that is showed in the file explorer : I want to
>> be
>> sure that the version of the registered ocx is correct before continuing
>> to
>> run a software which depends on the ocx. Does anyone has a solution ?
>> Thanks.
>>
>> Example in the Windows file explorer :
>> File version : 2.0.0.16
>>
>> VB6 ocx version :
>> MajorVer=2
>> MinorVer=0
>> RevisionVer=16
>>
>> -------------------------------------------------------
>> Patrice Dargenton
>> patrice.dargen***@free.fr
>> http://patrice.dargenton.free.fr/index.html
>> -------------------------------------------------------
>>
>>
>>
>> .
>>
>
> To get the version information on a file, use the FileVersionInfo class.
> The class documentation is available here:
> http://msdn.microsoft.com/en-us/library/system.diagnostics.fileversioninfo.aspx
>
> Mike