|
-
Dec 8th, 2005, 06:53 AM
#1
Thread Starter
Junior Member
string from dll truncated
I'm using a c++ DLL, which takes as a parameter a structure from VB, like this:
Public Type ODATA
lReadError As Long
szData As String * 128
End Type
I have declared the function as ByRef pOData As ODATA).
The problem is that when c-function returns the filled structure, the string part is not as it should. The first bytes have been dissappeared. If that function is used from another c code it returns correctly everything but not if called from VB. For example calling from c it returns a string "abcdefg", but called from VB it gets only the value "efg". I think it has something to do with VB way of handling strings with two bytes for pointer and length in the beginning.
How should I use/declare variables to receive the whole string?
The C DLL is not made specially for VB. I use VB 5.
Thanks in advance.
/petri
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|