Пример #1
0
        /// <summary>
        /// Used to pump any pending COM messages. This should be used only as a part of
        /// synchronizing or to effect a block until all other threads has finished with
        /// their pending COM calls. This should be used by the UI thread **ONLY**;
        /// otherwise execptions will be thrown. This is mandatory when the COM objects are
        /// STA which would otherwise deadlock in other threads.
        /// </summary>
        /// <remarks>
        /// Typical use would be within a event handler for an event belonging to a COM
        /// object which require some synchronization with COM accesses from other threads.
        /// Events raised by COM are on UI thread by definition so the call stack originating
        /// from COM objects' events can use this method.
        /// </remarks>
        /// <returns>Count of open forms which is always zero for VBA hosts but may be nonzero for VB6 projects.</returns>
        public int PumpMessages()
        {
            CheckContext();

            return(_runtime.DoEvents());
        }
Пример #2
0
 public int DoEvents()
 {
     return(_runtime.DoEvents());
 }