Can anyone provide me with an example on how to handle the Company Changed event?
What I do now is something like this (the SetApplication works when I connect in the first place):
Dim sConnectionString As String
Dim SboGuiApi As SAPbouiCOM.SboGuiApi
Private Sub con_AppEvent(ByVal EventType As SAPbouiCOM.BoAppEventTypes) Handles SBO_Application.AppEvent
Select Case EventType
vcmp = Nothing
Dim str as string
SBO_Application = SboGuiApi.GetApplication()
vcmp = New SAPbobsCOM.Company()
str = vcmp.GetContextCookie()
str = SBO_Application.Company.GetConnectionContext(str)
. . .
The problem is, that I keep getting the CompanyChanged event. My guess is that it is because I reconnect to the application before the eventhandler has returned, but I can't really figure out how to do....
Any help appriciated.
Thanks in advance