Solved

How to get the version of a  ActiveX control?

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

Expert Comment

by:DragonSlayer
ID: 6311042
Have you tried GetVersionOfFile?
0
 
LVL 20

Accepted Solution

by:
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;
begin
  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);
  end;
end;

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

Regards, Madshi.
0
 
LVL 20

Expert Comment

by:Madshi
ID: 6311896
Hmmm... May I ask: What was missing for an A grade?
0
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

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

Author Comment

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

Author Comment

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

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 (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) 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