Jump to content
Sign in to follow this  

Need help converting this Visual Basic Demo to Autoit

Recommended Posts


Attribute VB_Name = "Module1"
'  DACAL Library Demo
'  Visual Basic 6.0
'  Steve Gilbert 5-15-2003
'  scg8172@hotmail.com
Public fMainForm As frmMain

Const gDEVICE_IDERROR As Long = 1
Const gDEVICE_BUSY As Long = 2

Public gVoid As Long
Public gDeviceCount As Long
Public gDeviceID() As Long
Public gI As Long
Public gID As Long
Public gIndex As Long
Public gStatus As Long

' Functions to init USB CD Library
Public Declare Function InitUSBCDLibrary Lib "" () As Long
Public Declare Function CloseUSBCDLibrary Lib "" () As Long
Public Declare Function GetDeviceNumber Lib "" () As Long
Public Declare Function EnumDevice Lib "" (ByVal gI As Long) As Long
' Functions to operate USB CD Library
Public Declare Function USBCDReset Lib "" (ByVal gID As Long) As Long
Public Declare Function USBCDMoveto Lib "" (ByVal gID As Long, ByVal gIndex As Long) As Long
Public Declare Function USBCDGetCDDown Lib "" (ByVal gID As Long) As Long
Public Declare Function USBCDLEDON Lib "" (ByVal gID As Long) As Long
Public Declare Function USBCDLEDOFF Lib "" (ByVal gID As Long) As Long
Public Declare Function USBCDGetStatus Lib "" (ByVal gID As Long) As Long

Sub Main()
    gVoid = InitUSBCDLibrary()
    gDeviceCount = GetDeviceNumber()
    ReDim gDeviceID(gDeviceCount)
    Let gI = 0
    While gI < gDeviceCount
        gDeviceID(gI) = EnumDevice(gI)
        Debug.Print gDeviceID(gI)
        gI = gI + 1
    Set fMainForm = New frmMain
    Load fMainForm
End Sub

=================All Dll Functions (Copied From Dll Extractor)========================
Function Name           Address Relative Ad Ordinal     Filename
CloseUSBCDLibrary       0x0043f470  0x0003f470  23 (0x17)   USBCDDLL.dll
CloseUSBCDLibrary@0     0x0043f470  0x0003f470  11 (0xb)        
EnumDevice          0x0043f498  0x0003f498  20 (0x14)       
EnumDevice@4            0x0043f498  0x0003f498  8 (0x8)     
GetDeviceNumber     0x0043f48c  0x0003f48c  21 (0x15)       
GetDeviceNumber@0       0x0043f48c  0x0003f48c  9 (0x9)     
InitUSBCDLibrary        0x0043f448  0x0003f448  24 (0x18)       
InitUSBCDLibrary@0      0x0043f448  0x0003f448  12 (0xc)        
SetCDCallbackProc       0x0043f47c  0x0003f47c  22 (0x16)       
SetCDCallbackProc@4     0x0043f47c  0x0003f47c  10 (0xa)        
USBCDGetCDDown      0x0043f4d8  0x0003f4d8  17 (0x11)       
USBCDGetCDDown@4        0x0043f4d8  0x0003f4d8  5 (0x5)     
USBCDGetCDUp        0x0043f4ec  0x0003f4ec  16 (0x10)       
USBCDGetCDUp@4      0x0043f4ec  0x0003f4ec  4 (0x4)     
USBCDGetStatus      0x0043f528  0x0003f528  13 (0xd)        
USBCDGetStatus@4        0x0043f528  0x0003f528  1 (0x1)     
USBCDLEDOFF     0x0043f514  0x0003f514  14 (0xe)        
USBCDLEDOFF@4       0x0043f514  0x0003f514  2 (0x2)     
USBCDLEDON          0x0043f500  0x0003f500  15 (0xf)        
USBCDLEDON@4        0x0043f500  0x0003f500  3 (0x3)     
USBCDMoveto         0x0043f4c0  0x0003f4c0  18 (0x12)       
USBCDMoveto@8       0x0043f4c0  0x0003f4c0  6 (0x6)     
USBCDReset          0x0043f4ac  0x0003f4ac  19 (0x13)       
USBCDReset@4        0x0043f4ac  0x0003f4ac  7 (0x7)

Or some pointers on how to use/call the Dll?

Many Thanks!

2015 - Still no flying cars, instead blankets with sleeves.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.