How to get the version of a  ActiveX control?

Posted on 2001-07-23
Last Modified: 2010-04-06
I have a ocx file, but I don't know It's version ,how to get it? thinks
Question by:luxee
  • 3
  • 2
LVL 14

Expert Comment

ID: 6311042
Have you tried GetVersionOfFile?
LVL 20

Accepted Solution

Madshi earned 50 total points
ID: 6311740
I'm using these two functions:

function GetFileVersion(file_: string) : int64;
var len, hnd : dword;
    buf      : string;
    pfi      : PVsFixedFileInfo;
  result := 0;
  len := GetFileVersionInfoSize(pchar(file_), hnd);
  if len <> 0 then begin
    SetLength(buf, len);
    if GetFileVersionInfo(pchar(file_), hnd, len, pointer(buf)) and
       VerQueryValue(pointer(buf), '\', pointer(pfi), len) then
      result := int64(pfi^.dwFileVersionMS) shl 32 + int64(pfi^.dwFileVersionLS);

function FileVersionToStr(version: int64) : string;
  result := IntToStrEx( version shr 48           ) + '.' +
            IntToStrEx((version shr 32) and $FFFF) + '.' +
            IntToStrEx((version shr 16) and $FFFF) + '.' +
            IntToStrEx( version         and $FFFF);

Regards, Madshi.
LVL 20

Expert Comment

ID: 6311896
Hmmm... May I ask: What was missing for an A grade?
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.


Author Comment

ID: 6311909
Oh,sorry,but how to select a grade for you now?

Author Comment

ID: 6311950
Oh,sorry,but how to select a grade for you now?

Author Comment

ID: 6312039
Oh,sorry,but how to select a grade for you now?

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
add combobox item based on numbers 9 154
Delphi IDE crash without error message ... 7 99
Firemonkey android show image from resource ? 1 46
Delphi...Split view - idea? 1 90
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
In a recent question ( here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question