Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

SHDocVw and SBO

Hello guys, I'm trying to add an instance os Internet Explorer ActiveX into a SBO form using C#, the code I'm using is the following:

SAPbouiCOM.Form oGenericForm = null;
SAPbouiCOM.FormCreationParams oGenericFormCreationParams = null;
SAPbouiCOM.Item oGenericItem = null;
SAPbouiCOM.ActiveX oActive = null;
SHDocVw.InternetExplorer oSHDocVw = null;
System.Object nullObject = 0;
string str = "";
System.Object nullObjStr = str;
try
{
    oGenericForm = oSBOApplication.Forms.Item("_BrowserForm1");
}
catch
{
    try
    {
        // Main form creation
        oGenericFormCreationParams = (SAPbouiCOM.FormCreationParams)oSBOApplication.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams);
        oGenericFormCreationParams.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Sizable;
        oGenericFormCreationParams.FormType = "fBrowserForm1";
        oGenericFormCreationParams.UniqueID = "_BrowserForm1";
        oGenericForm = oSBOApplication.Forms.AddEx(oGenericFormCreationParams);
        oGenericForm.Visible = false;
        oGenericForm.AutoManaged = false;
        oGenericForm.Top = 20;
        oGenericForm.Left = 280;
        oGenericForm.Width = 640;
        oGenericForm.Height = 480;
        oGenericForm.Title = "SBO Internet Browser";
        // Web browser activeX component creation
        oGenericItem = oGenericForm.Items.Add("brs", SAPbouiCOM.BoFormItemTypes.it_ACTIVE_X);
        oGenericItem.Top = 5;
        oGenericItem.Left = 5;
        oGenericItem.Width = oGenericForm.Width - 10;
        oGenericItem.Height = oGenericForm.Height - 10;

        oActive = ((SAPbouiCOM.ActiveX)(oGenericItem.Specific));
        oActive.ClassID = ((SAPbouiCOM.ActiveX)(oGenericItem.Specific)).ClassID = "Interop.SHDocVw";
        oSHDocVw = ((SHDocVw.InternetExplorer)(oActive.Object));
        
        oSHDocVw.Navigate("http:///sdn.sap.com", ref nullObject, ref nullObjStr, ref nullObjStr, ref nullObjStr);
    }
    catch (Exception er)
    {
        oSBOApplication.MessageBox(er.Message, 0, "Ok", "", "");
    }
}
oGenericForm.Visible = true;

When I run that code I got the following error message:

Invalid class sequenca (HRESULT: 0x800401F3) (CO_E_CLASSTRING))

Does anyone knows what I'm missing?

I'm probably doing some bad cast, do you have any idea on how to fiz that?

Thanks in advance.

Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question