PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Mode for sharing the events
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Creates an event. An event is used to synchronize several threads at the same time. If the event is open, all the threads waiting for the event are unlocked.
Example
// Create an event
EventCreate("Let's go", eventManual, eventClose)
// Run a first thread
ThreadExecute("Thread1", threadNormal, "Thread_First")
// Locks the current thread until the event is obtained
ThreadWaitSignal()
 
// Run a second thread
ThreadExecute("Thread2", threadNormal, "Thread_Second")
// Locks the current thread until the event is obtained
ThreadWaitSignal()
 
// Modifies the event to run the threads
EventChange("Let's go", eventOpen)
//----------------------------------------------
PROCEDURE Thread_First()
Trace(dbgInfo(dbgProcess) + " - ThreadSendSignal(threadMain)")
ThreadSendSignal(threadMain)
EventWait("Let's go")
Trace(dbgInfo(dbgProcess) + " - Event received")
//--------------------------------------------
PROCEDURE Thread_Second()
Trace(dbgInfo(dbgProcess) + " - ThreadSendSignal(threadMain)")
ThreadSendSignal(threadMain)
EventWait("Let's go")
Trace(dbgInfo(dbgProcess) + " - Event received")
Syntax
EventCreate(<Event> [, <Mode> [, <Initial status> [, <Options>]]])
<Event>: Character string (with quotes)
Name of the event to create. This name will be used by all the event management functions.
<Mode>: Optional constant
Mode for managing the event:
eventAutomatic
(Default value)
After its opening, the event is automatically closed as soon as a single thread is unlocked.
eventManualThe event is modified by EventChange.
<Initial status>: Optional constant
Initial status of the event:
eventOpenThe event is open when it is created.
eventClose
(Default value)
The event is closed during its creation.
<Options>: Optional Integer constant
  • Mode for sharing the event:
    shareNoneThe event is specific to the application. If EventDestroy is not called, the event is destroyed at the end of the application.
    shareGlobalThe event is shared between all the applications found on the computer.
    shareUser
    (Default value)
    The event is shared between all the applications of the session of the user who runs the application.
Versions 17 and later
  • Mode for destroying the event:
    Versions 17 and later
    DestructionWithoutModification
    New in version 17
    DestructionWithoutModification
    DestructionWithoutModification
    By default, an event is automatically modified during its destruction. If the event is created with the DestructionWithoutModification constant, it will not be modified during the call to EventDestroy or during the automatic destruction of the event when closing the application.
The information regarding the share mode and the destruction mode of the event can be combined.
New in version 17
  • Mode for destroying the event:
    Versions 17 and later
    DestructionWithoutModification
    New in version 17
    DestructionWithoutModification
    DestructionWithoutModification
    By default, an event is automatically modified during its destruction. If the event is created with the DestructionWithoutModification constant, it will not be modified during the call to EventDestroy or during the automatic destruction of the event when closing the application.
The information regarding the share mode and the destruction mode of the event can be combined.
  • Mode for destroying the event:
    Versions 17 and later
    DestructionWithoutModification
    New in version 17
    DestructionWithoutModification
    DestructionWithoutModification
    By default, an event is automatically modified during its destruction. If the event is created with the DestructionWithoutModification constant, it will not be modified during the call to EventDestroy or during the automatic destruction of the event when closing the application.
The information regarding the share mode and the destruction mode of the event can be combined.
Remarks
Reports and Queries

Mode for sharing the events

In shareUser mode, the event is shared between all the applications of the session of the user who runs the application.
  • The event is created by the first application of the session of the user who calls EventCreate.
  • The following applications that call EventCreate connect to the existing semaphore.
  • The last application that is closed destroys the event.
  • An event with the same name cannot be used by a session of another user on the same computer: the system returns an error of access rights.
In shareGlobal mode, the event is shared among all the applications found on the computer.
  • The event is created by the first application that calls EventCreate.
  • The following applications that call EventCreate connect to the existing semaphore.
  • The last application that is closed destroys the event.
Component : wd250vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment