Click to See Complete Forum and Search --> : String from a dll


Annu Ittyachen
May 29th, 2001, 04:07 AM
Hi,

I am calling a dll function that returns a string in VB. In the dll I am returning a BSTR.
But in VB i get only the first letter of the string
The function is declared in VB as

Declare Function GetFileName Lib "MyDll.dll" () as string




And I in the code I am calling

Dim strTemp as string
strTemp = GetFileName




How can I get the whole string ?

cksiow
May 29th, 2001, 04:34 AM
seems like your are encounter the problem of ANSI and UNICODE conversion. maybe you should consider return char* instead of BSTR.

HTH

cksiow
http://vblib.virtualave.net - share our codes