VARIANT type problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ZhangZQ

    #1

    VARIANT type problem

    If I have a method in an OCX, the definition is

    [id(5), helpstring("Met hod Test1")] void Test1(VARIANT* a);

    After I add reference to this OCX in Visual studio .net, it generates 2
    dlls, and I look at the object browser, the definition of the above method
    in the wrapper class is

    Test1(ref object);

    Now I use the C# to call this method,

    object myObj = new object();
    MyOCX.Test1(ref myObj); // Then it will throw an exception with error
    message "type mismatch"

    and no matter which value I set to myObj it always throws the exception with
    the same error message.


    I want to know how to call that
    [id(5), helpstring("Met hod Test1")] void Test1(VARIANT* a); method?


    Thank you very much!


Working...