Bull DPX/20 Guia do Utilizador Página 178

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 424
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 177
2-10
SOMobjects Base Toolkit: Programmers Reference Manual
SOMD_RegisterCallback Function
Purpose
Registers a callback function for handling DSOM request events.
C Syntax
void SOMLINK SOMD_RegisterCallback (SOMEEMan emanObj, EMRegProc *func);
Description
When writing event-driven applications where there are event sources other than DSOM
requests (for example, user input, mouse clicks, and so forth), DSOM cannot be given
exclusive control of the “main loop,” such as when execute_request_loop is
called. Instead, the application should use the Event Management (EMan) framework to
register and process all application events.
The SOMD_RegisterCallback function is used to register a user-supplied DSOM event
handler function with EMan. The caller need only supply an address of the event handler
function, and the instance of the EMan object — the details of registration are implemented
by SOMD_RegisterCallback.
Callback functions should have the SOMLINK keyword explicitly specified, except on
Windows. Using an explicit SOMLINK keyword on Windows will preclude the ability of an
application to support multiple instances.
Note: The function SOMD_RegisterCallback must be declared with “system linkage” on
OS/2.
Parameters
emanObj A pointer to an instance of SOMEEman, the Event Manager object.
func A pointer to an event handler function which will be called by EMan
whenever a DSOM request arrives. This function must have the following
prototype (equivalent to the EMRegProc type defined in the eman.h file):
#ifdef __OS2__
#pragma linkage(func, system)
#endif
void SOMLINK func (SOMEEvent event, void *eventData)
/* On Windows, using the SOMLINK keyword precludes
* the support of multiple instances. */
Vista de página 177
1 2 ... 173 174 175 176 177 178 179 180 181 182 183 ... 423 424

Comentários a estes Manuais

Sem comentários