S
skg
I have following function in unmanged code
BOOL _stdcall ExtractId(
String *psclr_File, String *psclr_Id)
{
....
BSTR *lplpszMessageId;
System::IntPtr target = lplpszMessageId;
psclr_Id= Marshal:
trToStringBSTR(target); //psclr_Id shows correct value
assigned to it when debugging.
.....
}
when my call returns the value of psclr_Id is blank.
I have declared the function as follows in managed code.
[DllImport("msg.dll", CharSet=CharSet.Ansi,
CallingConvention=CallingConvention.Cdecl)]
public static extern bool ExtractId( String psg, String pID);
How can i return the string initialized from the unmanaged code.?
TIA
BOOL _stdcall ExtractId(
String *psclr_File, String *psclr_Id)
{
....
BSTR *lplpszMessageId;
System::IntPtr target = lplpszMessageId;
psclr_Id= Marshal:

assigned to it when debugging.
.....
}
when my call returns the value of psclr_Id is blank.
I have declared the function as follows in managed code.
[DllImport("msg.dll", CharSet=CharSet.Ansi,
CallingConvention=CallingConvention.Cdecl)]
public static extern bool ExtractId( String psg, String pID);
How can i return the string initialized from the unmanaged code.?
TIA