Click to See Complete Forum and Search --> : Accessing a String Value formVC++ in VB


pavan_raut
January 5th, 2000, 12:24 AM
Dear Friends;
There is Dll in VC++ which i am accessing in VB.I need to call a function from that DLL which returns me a String.Which String Datatype should i use in VC++ so that i can recieve it VB as string or variant.

Please help me ASAP.
Pavan

wolferl19
January 5th, 2000, 02:19 AM
You should always use the BSTR type. You can simply create such a datatype by writing

CString ReturnString = "abc";

return ReturnString.AllocSysString();

This will automatically create a BSTR type.