Solved

How to get the version of a  ActiveX control?

Posted on 2001-07-23
6
147 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

785 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