locked
32 bits pointer to a null terminated string RRS feed

  • Question

  • User-1857245866 posted

    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?

     

    Saturday, March 5, 2016 11:09 PM

All replies

  • User753101303 posted

    Hi,

    According to 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).

    Monday, March 7, 2016 9:07 AM
  • User-1857245866 posted

    Thanks for your reply. Although I think we're on the right track, I can't get it to work....

    Wednesday, March 9, 2016 6:55 PM