I wrestled with this one for awhile, but discovered (via Google) that you can use StringBuilder to allocate a fixed-length string, then pass the StringBuilder in by value to the exported function/method in the unmanaged DLL. Strings don't work in this case because they are not fixed length, and access violation errors can (and usually) occur.
Declare Ansi Function Function_Name Lib "lib.dll" (ByVal strGoingIn As String, ByVal strComingOut As StringBuilder) As Integer
Showing posts with label Unmanaged. Show all posts
Showing posts with label Unmanaged. Show all posts
Friday, June 29, 2007
Subscribe to:
Posts (Atom)