My aim is :- Pass C# object as a parameter of unmanaged Dll(vc++ 6.0)
method . with in the unmaaged dll methedod construct similar C++ class instance .
vice versa from dll method argument VARIANT result has to be converted to C# object
For this , I tried
Marshal.GetNativeVariantForObject(s, p);
or
Marshal.StructureToPtr(segInfo, ptrValue, false);
and
Marshal.GetObjectForNativeVariant(res)
But I got the error as like
An invalid VARIANT was detected during a conversion from an unmanaged VARIANT to a managed object. Passing invalid VARIANTs to the CLR can cause unexpected exceptions, corruption or data loss.
Source Files are attached
TestOne.zip is the VC++(6.0) unmanaged dll
TestACallFromDll.zip is C# application
Let me help as early as possible ....
Thanks In advance .
Regards,
Dileep S