Hi Steve,
to find your specific problem would take too long. Instead I suggest you use a "better" way to connect to SBO.
From your code it looks that you wanna make a single sign on ( UI and DI API through connected client ).
This would be a minimal working example to connect to both ( using "old" SBO 8.8x logic, converted from c# ) :
Dim mySAPGUI As New SAPbouiCOM.SboGuiApi() Dim ConnectionString As [String] = If(args.Count() > 0, args(0), "0030002C0030002C00530041005000420044005F00440061007400650076002C0050004C006F006D0056004900490056") Try mySAPGUI.Connect(ConnectionString) SBO_Application = mySAPGUI.GetApplication(-1) SBO_Company = TryCast(SBO_Application.Company.GetDICompany(), SAPbobsCOM.Company) If SBO_Company.Connected Then MessageBox.Show("Success") End If Catch ex As Exception MessageBox.Show("Connection Failed " + ex.Message) End Try
But for future addons I would recommend to use the new SBO 9.0 features using the included UI framework. For that install B1Studio for VS2010 and you will find a SBO template which does the basic connection and offers you a better way of handling events.
regards,
Maik