ActiveX TreeView HRESULT E_FAIL RRS feed

  • Question

  • I am trying to use an ActiveX TreeView in SAP Business One form.

    Even though I follow the example provided in the Business One SDK help, it doesn't work at all and I get a COM exception early in the code:

    Item oItem = Form.Items.Add("xml", SAPbouiCOM.BoFormItemTypes.it_ACTIVE_X);
                oItem.Visible = true;
                oItem.Top = 5;
                oItem.Left = 5;
                oItem.Width = 290;
                oItem.Height = 490;
                ActiveX AcXTree = oItem.Specific;
                AcXTree.ClassID = "MSComctlLib.TreeCtrl.2"; 
                MSComctlLib.TreeView2 treeView = AcXTree.Object;//EXCEPTION

    Exception: System.Runtime.InteropServices.COMException wurde nicht von Benutzercode behandelt.
      Message=Beim Aufruf einer COM-Komponente wurde ein HRESULT E_FAIL-Fehler zurückgegeben.
           bei SAPbouiCOM.IActiveX.get_Object()

    I also tried using the ActiveX TreeView class guid {C74190B4-8589-11D1-B16A-00C0F0283628} but I get the same result.

    I use Windows 7 64Bit and successfully registered MSComctl.ocx. I already asked on the SAP forum but did not get any answers so far.

    And is there a way to tell what went wrong? Apparently E_FAIL is a general failure and it tells me nothing.


    • Edited by Ishiirou Thursday, July 25, 2013 1:08 PM
    • Moved by CoolDadTx Thursday, July 25, 2013 1:53 PM Winforms related
    • Moved by Barry Wang Monday, July 29, 2013 7:36 AM
    Thursday, July 25, 2013 1:05 PM


All replies