cancel
Showing results for 
Search instead for 
Did you mean: 

Event deletion

former_member193355
Contributor
0 Kudos

Dear All Experts,

We have succeeded to develop SDK code or addon that used to be a report launcher of our crystal report. We use VB6 to develop it.

After SAP B1 closed, in the windows task manager --> tab applications, there are still catching event running.

how to resolve this issue ? Pls give advice. I appreciate it so much.

Steve

Accepted Solutions (1)

Accepted Solutions (1)

former_member186095
Active Contributor
0 Kudos

Steve,

try to add this following code in the application event:



Private Sub SBO_Application_AppEvent(ByVal EventType As SAPbouiCOM.BoAppEventTypes)
If EventType = SAPbouiCOM.BoAppEventTypes.aet_CompanyChanged Or EventType = SAPbouiCOM.BoAppEventTypes.aet_ShutDown 
Then
End
End If
End Sub

let me know if you still can't resolve it.

Rgds,

Answers (6)

Answers (6)

former_member193355
Contributor
0 Kudos

Hi All,

thx for your answers. it works well

Steve

Nussi
Active Contributor
0 Kudos

Hi,

beside the right code from jimmy (that code should help you) also add

Private Sub Class_Terminate()

End

End Sub

in your SBO class - this combined with jimmy's code should always close

the application

lg David

Former Member
0 Kudos

Hi..

Try this one..

System.Windows.Forms.Application.Exit()

replace of u give

Close()

Regards..

Billa 2008

former_member193355
Contributor
0 Kudos

Thx but still give no result.

Steve

Former Member
0 Kudos

Hi..

use

Me.Close() or Form.Close()

Regards..

Billa 2007

former_member193355
Contributor
0 Kudos

Hi All,

Thx for answer but the result is not okay yet.

The syntax :

Application.Exit()

become red color words in the VB. How to resolve it ?

Steve

Former Member
0 Kudos

Hi..

Application.Exit() replace

use this one

System.Windows.Forms.Application.Exit()

regards..

Billa 2007

Former Member
0 Kudos

Hi steve,

while building the Application what error it says..

Are you added the reference for system.windows.form ?

if not add the reference for that(Add reference-->in NET tab select reference system.windows.form)

in Application properties check the system.windows.form in imported name spaces option)

if not clear with this let me know..

Regards,

Ganesh K

former_member193355
Contributor
0 Kudos

Hi Ganesh,

Thx for answer.

There is no error while building the application. The system message after finishing paste the code is that COmpile error: Expected: =

then the System.Windows.Forms.Application.Exit() becomes red colour.

Where could I find the application properties ?

Steve

Former Member
0 Kudos

Hi...

Go Project-> Add Reference->COM

there u can select.

Regards...

Billa 2007

Former Member
0 Kudos

Hi steve,

in solution explorer right click of your application you can find properties..there you can have application,compile,debug,references,resources etc.....

the other way is,

once you added the reference for System.Windows.Forms,

just use

Imports System.Windows.Forms in your coding..

that also enough.....

Regards,

Ganesh k

former_member193355
Contributor
0 Kudos

Hi,

I can't find com in the references window. Also when pressing Ctrl+T, the Components window appear but there is no system.windows.forms. there.

I am using VB6.Tks

Steve

Former Member
0 Kudos

Hi steve sorry,

i think the references will differ for VB6. i was concentrated on vb.net and c#.net..

for vb6 try,

unload Me or End....

as mentioned we have to write on Application event only...

Regards,

Ganesh....

Former Member
0 Kudos

Hi steve,

use the following code in application event..

Private Sub sbo_application_AppEvent(ByVal EventType As SAPbouiCOM.BoAppEventTypes) Handles sbo_application.AppEvent

Select Case EventType

Case SAPbouiCOM.BoAppEventTypes.aet_ShutDown, SAPbouiCOM.BoAppEventTypes.aet_CompanyChanged

Application.Exit()

End Select

End Sub

Regards,

Ganesh K

Former Member
0 Kudos

hi,

Add below code in Application Event.

Private Sub SBO_Application_AppEvent(ByVal EventType As SAPbouiCOM.BoAppEventTypes) Handles SBO_Application.AppEvent

If EventType = SAPbouiCOM.BoAppEventTypes.aet_CompanyChanged Or EventType = SAPbouiCOM.BoAppEventTypes.aet_ShutDown Then

System.Windows.Forms.Application.Exit()

End If

End Sub

this kills the addon application process on stopping addon or SAP B1

regards,

varma

Edited by: Varma on Oct 16, 2008 4:36 PM