Call DLL

Command groupFlag affectedReversibleExecute on clientPlatform(s)
External commandsYESNONOWindows,Linux

Syntax

Call DLL
 
(library, procedure [,parameters...])
 
Returns 
return-value

Description

Note: The flag is set according to whether Omnis was able to make a call to this external command.

This command calls a procedure in a DLL, which you must have previously registered by calling Register DLL. The library is the name or pathname of the DLL containing the procedure specified by procedure; library and procedure must exactly match the values passed to Register DLL. The parameters are passed to the procedure when it is called, and must match the type-definition passed to Register DLL. The return value of Call DLL is the return value of procedure, and has the type specified by the type-definition.

Example

# Flash the Omnis window to attract the user's attention

 
# Win32 API to get the main Omnis window: HWND GetActiveWindow(VOID)

Register DLL
 
(
'USER32.DLL'
,
'GetActiveWindow'
,
'J'
)

Call DLL
 
(
'USER32.DLL'
,
'GetActiveWindow'
)
 
Returns 
lHWND

 
# Win32 API to Flash a window: BOOL FlashWindow(HWND, BOOL)

Register DLL
 
(
'USER32.DLL'
,
'FlashWindow'
,
'JJJ'
)

Call DLL
 
(
'USER32.DLL'
,
'FlashWindow'
,
lHWND
,1)
 
Returns 
lResult

 
# Activate a system beep

 
# MacOSX framework to activate a system beep: CarbonSound.framework

Calculate
 
lPath
 as 
"/System/Library/Frameworks/Carbon.framework/Versions/Current/Frameworks/CarbonSound.framework/Versions/Current/CarbonSound"

Register DLL
 
(
lPath
,
'SysBeep'
,
'JJ'
)

Call DLL
 
(
lPath
,
'SysBeep'
,10)