Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Ussing a DLL written in Delphi


Reply
 
Thread Tools Display Modes
  #1  
Old 06-12-2010, 09:20 AM
dotniet dotniet is offline
Newcomer
 
Join Date: Jun 2010
Posts: 4
Question Ussing a DLL written in Delphi


Hi.

I just found this amazing DLL that can extract the hardware ID (computer RAM, harddrive unique serial number, partition serial number, CPU unique serial number, etc) of a computer.

However, there is no documentation for VB users and it is written in Pascal and assembly language. Ya, sad

Can anybody help me to connect to this DLL?
The documentaton says that the DLL exports the following functions:
Code:
// CPU
function GetCPUSpeed: Double;
function CPUFamily: ShortString; { Get cpu identifier from the windows registry }
function GetCpuTheoreticSpeed: Integer; { Get cpu speed (in MHz) }
function IsCPUIDAvailable: Boolean; Register;
function GetCPUID (CpuCore: byte): ShortString;
Function GetCPUVendor: ShortString;


// RAM
function MemoryStatus (MemType: Integer): cardinal; { in Bytes }
function MemoryStatus_MB (MemType: Integer): ShortString; { in MB }


// HDD
function GetPartitionID (Partition : PChar): ShortString; { Get the ID of the specified patition. Example of parameter: 'C:' }
function GetIDESerialNumber(DriveNumber: Byte ): PChar; { DriveNr is from 0 to 4 }


MemoryStatus function can display:

MemoryLoad { Total memory used in percentage (%) }
TotalPhys { Total physical memory in bytes}
AvailPhys { Physical memory left in bytes}
TotalPageFile { Total page file in bytes}
AvailPageFile{ Page file left in bytes}
TotalVirtual{ Total virtual memory in bytes}
AvailVirtual { Virtual memory left in bytes}

I have never worked with DLLs until now.
Can anybody provide a piece of code that loads the DLL and accesses a function like GetCPUID?
Many thanks.
Reply With Quote
  #2  
Old 06-13-2010, 04:27 PM
dotniet dotniet is offline
Newcomer
 
Join Date: Jun 2010
Posts: 4
Default

bump
Reply With Quote
  #3  
Old 06-14-2010, 02:19 AM
Flyguy's Avatar
Flyguy Flyguy is offline
Lost Soul

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Vorlon
Posts: 18,883
Default

Most of these functions are just plain API calls.

You can find a lot of them here with sample code in VB6:
http://vbnet.mvps.org/
Reply With Quote
  #4  
Old 06-15-2010, 09:40 AM
dotniet dotniet is offline
Newcomer
 
Join Date: Jun 2010
Posts: 4
Default

thanks.

one more question: how do I convert that Delphi Shortstring to VB?
Reply With Quote
  #5  
Old 06-15-2010, 01:53 PM
dilettante's Avatar
dilettante dilettante is offline
Underclocked lifestyle

Forum Leader
* Guru *
 
Join Date: Feb 2005
Location: Michigan, USA
Posts: 4,184
Default

Even worse, once you have this working what does it actually do for anybody? This sort of info is already trivially available (right-click My Computer and choose Properties, go through Device Manager, etc.).
Reply With Quote
  #6  
Old 06-16-2010, 02:39 AM
Flyguy's Avatar
Flyguy Flyguy is offline
Lost Soul

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Vorlon
Posts: 18,883
Default

Quote:
Originally Posted by dotniet View Post
thanks.

one more question: how do I convert that Delphi Shortstring to VB?
You don't need it, it's just a way how the inner Delphi routine returns it's results.
If look at the Memory functions on the given website you will see that it uses other return types.
Reply With Quote
  #7  
Old 06-30-2010, 09:43 PM
dotniet dotniet is offline
Newcomer
 
Join Date: Jun 2010
Posts: 4
Default

thanks
that DLL works great now
Reply With Quote
Reply

Tags
delphi, dll, hardware, hardware id extracter


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->