📚 SAP Business One SDK Help

RemoveWindowsMessage Method
See Also  Example
messageType
The Windows message type, defined in BoWindowsMessageType.
toProcess
Indicates whether SAP Business One is to process the messages or not. If true, SAP Business One processes the messages; otherwise, SAP Business One discards them.

Description

This method enables you to deal with extreme scenarios. When an add-on needs to take a long time to process a UI API event, it prevents SAP Business One from processing the Windows message queue. Consequently, the message queue overflows, and if the add-on performs any other call back to SAP Business One via COM, it causes a system RPC failure.

Syntax

Visual Basic
Public Sub RemoveWindowsMessage( _
   ByVal messageType As BoWindowsMessageType, _
   ByVal toProcess As Boolean _
) 

Parameters

messageType
ValueDescription
bo_WM_TIMERRepresents the WM_TIMER message type of the Windows system.
The Windows message type, defined in BoWindowsMessageType.
toProcess
Indicates whether SAP Business One is to process the messages or not. If true, SAP Business One processes the messages; otherwise, SAP Business One discards them.

Remarks

If your add-on needs to do heavy work in handler procedure of an SAP Business One event, we recommend that you call this method per minute. Otherwise, you might get errors like "System call failed. (Exception from HRESULT: 0x80010100 (RPC_E_SYS_CALL_FAILED))". This may occurs on a non-server edition Windows system (for example, Windows 7 and Windows XP) due to the post message limit of the Windows system.

Example

Using the RemoveWindowsMessage method (C#)Copy Code
System.Threading.Thread.Sleep(1000 * 60); //replace with your real working code  
SBO_Application.RemoveWindowsMessage(SAPbouiCOM.BoWindowsMessageType.bo_WM_TIMER, true); 

See Also