CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Location
    India
    Posts
    196

    passing variants from C# client to MFC Automation enabled app

    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.
    Code:
    void Funct1(VARIANT *pVar) //is the MFC app function
    from C# side we invoke this as follows
    Code:
    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
    Intellectuals solve problems; geniuses prevent them.--Albert Einstein.

    Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute.THAT'S Relativity --Albert Einstein

  2. #2
    Join Date
    Sep 2003
    Location
    India
    Posts
    196

    Re: passing variants from C# client to MFC Automation enabled app

    Resolved the issue using VariantClass helps things work smoothly...thanks for all your time.
    Intellectuals solve problems; geniuses prevent them.--Albert Einstein.

    Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute.THAT'S Relativity --Albert Einstein

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured