I'm using A5v8. I'm trying to call a function in an external DLL. Here's the VBA code:
Private Declare Function GetHardwareID Lib "HardwareID.dll" (ByVal bHDD As Boolean, ByVal bNIC As Boolean, ByVal bCPU As Boolean, ByVal bBIOS As Boolean, ByVal sRegCode As String) As String.
Here's what I'm doing in Alpha:
I have to pass the function our registration code which unlocks the full version of the DLL.
The function call works fine, it returns the proper string, but I still get the nag screen. I have verified the registration code is good, the code works fine in VBA.
I've looked over other examples on the board and tried passing the registration code as a character variable and also as a pointer to a string:
Nothing I've tried so far has worked. According to the vendor's help file, this is how the function is declared:
LPTSTR WINAPI GetHardwareID(
BOOL bHdd,
BOOL bNic,
BOOL bCpu,
BOOL bBios,
LPCTSTR sRegCode
);
LPCTSTR is a Long Pointer Constant to a null-Terminated String. I also tried passing the serial as a Blob, no joy.
I've already emailed the vendor, but have not heard back from them yet. Is there something obvious I'm missing about passing a string to an external function?
Any help would be appreciated.
Rick
Private Declare Function GetHardwareID Lib "HardwareID.dll" (ByVal bHDD As Boolean, ByVal bNIC As Boolean, ByVal bCPU As Boolean, ByVal bBIOS As Boolean, ByVal sRegCode As String) As String.
Here's what I'm doing in Alpha:
Code:
' returns string, takes 4 booleans, and a string declare HardwareID GetHardwareID CWWWWC ' xxxx-xxxx is the registration code for removing nag window ' you pass the registration code and it does the call silently hdwid = GetHardwareID(0,0,1,1,"xxxx-xxxx")
The function call works fine, it returns the proper string, but I still get the nag screen. I have verified the registration code is good, the code works fine in VBA.
I've looked over other examples on the board and tried passing the registration code as a character variable and also as a pointer to a string:
Code:
dim temp as p temp.sSerial = "xxxx-xxxx" hdwid = GetHardwareID(0,0,1,1,temp)
LPTSTR WINAPI GetHardwareID(
BOOL bHdd,
BOOL bNic,
BOOL bCpu,
BOOL bBios,
LPCTSTR sRegCode
);
LPCTSTR is a Long Pointer Constant to a null-Terminated String. I also tried passing the serial as a Blob, no joy.
I've already emailed the vendor, but have not heard back from them yet. Is there something obvious I'm missing about passing a string to an external function?
Any help would be appreciated.
Rick
Comment