G’Day,
Got a bit of a weird one here. We have a DLL that we need to use to access a government claiming facility. I can link to the DLL with no problems and call functions from that DLL using either the old Declare statement or the newer .NET .
Anyway, my problem is that all functions SHOULD return a Long value which is’ 0′ if successful or a 4 digit error code if there was an error. No matter what I do, all return values from these functions are about 17 digits long, even if the function call was successful! I suspect this is some kind of handle address or ID for the function. I have tried using the whole IntPtr, assign some memory and use the Marshal.WriteInt64 function to get the return code but I still get the same handle ID. Any ideas on this one?
As an Example
The following code gets the version of the DLL module being used. It has one input, one output and a return value.
Function declaration:
Public Declare Function getVersionId Lib "c:easyclaimeasyclaimc.dll" (ByVal OutputBuffer As String, ByVal BufferSize As Long) As Long
OutputBuffer: Is a pointer to a NULL terminated string that returns the version of the DLL being used
BufferSize: The size of the buffer that will store the NULL terminated string
Return: A Long which is either 0 for success or a 4 digit error code
Function Call:
Dim lngReturn as Long Dim lngBuffer as Long = 50 lngReturn = getVersionID(strOutput, lngBuffer) messagebox.show(lngReturn.ToString)
The output (messagebox) is something like: 17632472837652480
Can anybody help with this one? We (obviously) don’t have access to the DLL source code and the support desk don’t provide language specific support (although their examples in the API show exactly what I’ve just demonstrated for VB).
Cheers
Toncc