Click to See Complete Forum and Search --> : passing variants from C# client to MFC Automation enabled app


venkyhyd
October 6th, 2008, 01:47 AM
Hello

When try to send a ref of array string to the variant pointer we get DISP_E_TYPEMISMATCH exception.
Eg:
MFC App is OLE Automation enabled.
void Funct1(VARIANT *pVar) //is the MFC app function
from C# side we invoke this as follows
string [] str = new string[100];
Object obj = (Object) str;
mfcAutoApp.Funct1(ref obj); // this would throw the DISP_E_TYPEMISMATCH exception.
Any suggestions on this...

-thanks

venkyhyd
October 7th, 2008, 04:22 AM
Resolved the issue using VariantClass helps things work smoothly...thanks for all your time.