TargetInvocationException

    Date: 05/04/07 (C Sharp)    Keywords: no keywords

    Hi, I need advise:

    private object _o; /* Apollo object */
    private System.Type t; /* for COM ProgID */

    t = Type.GetTypeFromProgID("ApAuto");
    _o = new object();
    _o = Activator.CreateInstance(t);

    int[] its = new int[1000];
    args[0] = (object)(this._SectionID);
    args[1] = its;

    bool ret;
    ret = (bool)t.InvokeMember("GetItemList", System.Reflection.BindingFlags.InvokeMethod, null, this._o, args);

    And I'm getting [System.Reflection.TargetInvocationException] = {"Exception has been thrown by the target of an invocation."} on t.InvokeMemeber.

    My opinion there is something wrong when I'm passing array as a parameter, but I'm not sure.

    There is also description of GetItemList function:

    GetItemList
    Description: GetItemList retrieves an array of the Record IDs for all items in a section.

    Syntax: bool GetItemList (long SectionID, variant far *ItemArray)

    Elements: SectionID Identifier of the section with the data to retrieve.
    ItemArray Array of items in the section.

    Please let me know what am I doing wrong.
    Thank you.

    Source: http://community.livejournal.com/csharp/85062.html

« Composite Controls || Web Browser code in C# »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home