URGENT How to return String from VC++ component to VB client?

Hey there,

I have written a component using Vc++ ATL. I need to return a string to my VB client. The length of this string can vary depending upon the request to the component.

I have declared a function in an interface using VC++ ATL. The declaration is given below

ReceiveReqXML(OLECHAR *poleszReqXML, int iIntReqNbr,OLECHAR** outstr)

NOTE: The last parameter "outstr" was supposed to contain the return string.

When I try to utilize this function from within my VB client, it says "ByRef Argument Type Mismatch". The VB client code is below

Dim outstr As String
Dim iReqNbr As Integer
Dim pwszReqStr As String

outstr = String(255, "x")
iReqNbr = 124
pwszReqStr = "Some String"

Call b.ReceiveReqXML(pwszReqStr, iReqNbr, outstr)

I am novice using VB. Can someone help me with this? I need this very urgent
[911 byte] By [Dinakaran] at [2007-11-17 17:09:38]
# 1 Re: URGENT How to return String from VC++ component to VB client?
here's a sample of connecting VB to a C DLL with several variable types being passed back and forth.

You should be able to adapt this to your needs.
phinds at 2007-11-10 0:22:40 >