I have an application and I am facing some serious problems. This application is preventing the user to log off. Each time when log off it crashed. How to log off properly?
Any suggestions will be well received.
Thanks.
write a bat file that calls two programs, the first is a .net C# console app that runs this code in it's main method:
foreach (var process in Process.GetProcessesByName("apppreventinglogoff.exe"))
{
process.Kill();
}
then the bat file can call "logoff.exe"
Assuming your application is an SAP Business One Add-On, it sounds like you're not handling the SAP application close/shut-down events:
obj.SBO_Application.AppEvent += new _IApplicationEvents_AppEventEventHandler(SBO_AppEvent);
Then in your SBO_AppEvent method you'd do something like this:
switch(EventType)
{
case SAPbouiCOM.BoAppEventTypes.aet_ServerTermination:
System.Windows.Forms.Application.Exit();
break;
case SAPbouiCOM.BoAppEventTypes.aet_ShutDown:
System.Windows.Forms.Application.Exit();
break;
}