Call C++ DLL from VB6 using user-defined data type
Posted on 2000-03-08
From VB, I'm calling a DLL created with C++. When I pass in a string ByVal, the DLL funstions fine. When I pass, ByRef, a user-defined data type including strings and longs, the DLL fails.
I've setup an identical structure in Vb to match what is defined in the DLL (including the use of fixed length strings).
I believe using fixed length VB strings will give me a null terminated string in the C-based DLL.
The problem is complicated because I cant find a way to get into debug mode to test the DLL by stepping into it from the VB call. As a result, I first created and debugged the code with a C-based EXE, then, moved the functions into the DLL.