C# object[,] dont get data from variant(,) com vb6.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • miguele2012
    New Member
    • Mar 2012
    • 3

    #1

    C# object[,] dont get data from variant(,) com vb6.0

    Hello I am developing a web application in visual 2008(c#)
    that communicates with a component servce (COM VB 6.0)
    and got the communication, but my problem is this:

    using the function I send some parameters by reference one of then its a Variant (,) in VB 6.0 that its elements can be of different types.
    I use a Object[,] with default values ​​to have the same structure
    for example:
    the element [0,1] its a long and the element[1,1] its a string

    I have already listed structure, but for some reason I can not bring the data from Variant(,) to Object[,]

    is that if you are bringing data for monitoring and fact

    the problem is that


    mi code is the follow:

    Code:
    public bool login(string Param1, string Param2, ref Object[,] RefParam, int Param3)
            {
    //this is the class in Component Service
                Type objAddType = Type.GetTypeFromProgID("ProjectCOM.ClassCOM");
                object objAdd = Activator.CreateInstance(objAddType);
                object mConnectionString = "ConnectionStringToSQL2008R2";
                object[] myArguments = { Param1, Param2, mConnectionString, RefParam, String.Empty, String.Empty, Param3};
    //this is to indicate which is the parameter by reference 
                ParameterModifier p = new ParameterModifier(7);
    //in this case is the fourth parameter (Object[,])
                p[3] = true;
                ParameterModifier[] pmArray = { p };
                            object retorna = objAddType.InvokeMember("COMMethod", BindingFlags.InvokeMethod, null,
                                                         objAdd, myArguments, pmArray, null, null);
                return
                    Convert.ToBoolean(retorna);
            }

    I need the RefParam have the data fetched from VB6.0

    HOPE CAN HELP
    Last edited by PsychoCoder; Mar 16 '12, 05:53 AM. Reason: Code tags added
  • miguele2012
    New Member
    • Mar 2012
    • 3

    #2
    solved!!!!!.... ............... .

    Comment

    Working...