SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Oct 2001
    Location
    Cupertino, CA, USA
    Posts
    37
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Using DLL\'s to Get File Version Info

    Hi

    I was wondering if there were an examples to get file version information using Silk's DLL mechanism to call out to Windows functions. I'm close, but I am having problems with the VerQueryValue function. Thanks

    ------------------

  2. #2
    Junior Member
    Join Date
    Apr 2002
    Location
    India
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Using DLL\'s to Get File Version Info

    Hi Adanm,

    The following script gets the file size using Win DLL function "GetCompressedFileSizeA". U can use this as a template and work out the specific implementation u need.

    use "mswtype.inc";
    dll "kernel32.dll"
    {
    DWORD GetCompressedFileSizeA (in STRING lpFileName, out DWORD lpFileSizeHigh);
    }
    testcase Sample () appstate none
    {
    HFILE hFileOutPut;
    STRING lpFileName;
    DWORD lpFileSizeHigh = 1;
    DWORD lpFileSizeLow = 0;
    INTEGER iCount;
    LIST OF FILEINFO lfFiles;
    hFileOutPut = FileOpen ("c:\temp\output.txt", FM_WRITE);
    lfFiles = SYS_GetDirContents ("c:\temp");
    for iCount = 1 to ListCount (lfFiles)
    {
    lpFileName = "c:\temp" + "\" + lfFiles[iCount].sName;
    lpFileSizeLow = GetCompressedFileSizeA (lpFileName, lpFileSizeHigh);
    FileWriteLine (hFileOutPut, "{lpFileName}""{lpFileSizeLow}");
    FileWriteLine (hFileOutPut, "");
    }
    FileClose (hFileOutPut);
    }


    ------------------

  3. #3
    Senior Member
    Join Date
    Jul 2001
    Location
    Elizabeth, CO, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Using DLL\'s to Get File Version Info

    You can also get a DLL function that's more easily used in SilkTest at the link below. It has functions in it for retrieving all kinds of information from files. I, too, had issues with the pointers in VerQueryValue, so I built a DLL wrapper for all of the calls required to get version inforamtion and put it into the DLL below.

    Amelior SilkTools.dll

    There are also functions in there for deactivating/reactivating your screen saver, working with registry entries (USE WITH EXTREME CAUTION), and getting other system information.

    - Dave


    ------------------
    Amelior Technology
    dreed@ameliortech.com

    [This message has been edited by dcreed (edited 04-30-2002).]
    WaltzingRhino.com
    A concerned Borland customer, a fly in the ointment, a wrench in the works.

  4. #4
    Senior Member
    Join Date
    Nov 1999
    Location
    Eagle, ID,USA
    Posts
    1,035
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Using DLL\'s to Get File Version Info

    If you have the NT Resource Kit - Server version, there is a utility called FileVer that you can call via the SYS_Execute function to return all file version information on executables and dll files. Very easy to use.

    ------------------
    Have you ever noticed? Anybody going slower than you is an idiot, and anyone going faster than you is a maniac.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.40 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.00%
vBulletin Optimisation provided by vB Optimise v2.7.1 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.3.0 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 06:21 PM.

Copyright BetaSoft Inc.