Last post Mar 09, 2016 06:55 PM by mpurpess
Mar 05, 2016 11:09 PM|mpurpess|LINK
I'm trying to use some functions in a windows DLL in VB.NET like:
Private Declare Function GetVersion Lib "C:\Program Files\.....\my.dll" () As Integer
This is working fine. Another function requires a parameter
Private Declare Function Test Lib "C:\Program Files\.....\my.dll" (mydate as ?????) As Integer
The problem is, that the documentation says that mydate needs to be a 32 bits pointer to a null terminated string in the format yyyyMMdd. I tried
mydate as String with "20160304" as the value
but the DLL returns a error which according to the documentation is an internal error. What exactly is "a pointer to a null terminated string", and how do I declare my function?
Mar 07, 2016 09:07 AM|PatriceSc|LINK
https://msdn.microsoft.com/en-us/library/s9ts558h(v=vs.110).aspx try using the LPStr or LPWStr attributes (strings are usually stored either by storing first the string length and then its characters or by storing its characters followed by a 0 character
to mark the end of the the string).
Mar 09, 2016 06:55 PM|mpurpess|LINK
Thanks for your reply. Although I think we're on the right track, I can't get it to work....