|
-
Mar 5th, 2001, 04:31 AM
#1
Thread Starter
New Member
I have a query regarding the passing and returning of string parameters from VB to exposed function in dll written on VC.
Say in the given scenario below,
In VB bas module:
Declare function encode_str lib "encoder.dll" (ByVal strInput As String,
ByRef strOutput As String,ByRef strOuputLen As Long) As Long
In VC:
long encode_str(LPSTR strInput,LPSTR *strOutput,long *strOutputLen)
In VB form:
Dim strInput,strOutput As String
Dim strOutputLen As Long
Dim retval As Long
strOutput = String(256,vbNullChar)
retval = encode_str(strInput,strOutput,strOutputLen)
MsgBox strOutput
The above code seems to work once, but on further calls to "encode_str", the call fails to generate any strOutput result to be passed back to the VB form.
Anyone has any idea or suggestions? Thanks.
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
|