DLGINIT, DLGINITWITHRESOURCEHANDLE (W*32, W*64)

Dialog Functions: Initialize a dialog box.

Module

USE IFLOGM

Syntax

result = DLGINIT (id,dlg)

result = DLGINITWITHRESOURCEHANDLE (id,hinst,dlg)

id

(Input) INTEGER(4). Dialog identifier. Can be either the symbolic name for the dialog or the identifier number, both listed in the Include file (with extension .FD).

dlg

(Output) Derived type dialog. Contains dialog box parameters.

hinst

(Input) INTEGER(4). Module instance handle in which the dialog resource can be found.

Results

The result type is LOGICAL(4). The result is .TRUE. if successful; otherwise, the result is .FALSE..

DLGINIT must be called to initialize a dialog box before it can be used with DLGMODAL, DLGMODELESS, or any other dialog function.

DLGINIT will only search for the dialog box resource in the main application. For example, it will not find a dialog box resource that has been built into a dynamic link library.

DLGINITWITHRESOURCEHANDLE can be used when the dialog resource is not in the main application. If the dialog resource is in a dynamic link library (DLL), hinst must be the value passed as the first argument to the DLLMAIN procedure.

Dialogs can be used from any application, including console, QuickWin, and Windows* applications.

Compatibility

CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB

Example

USE IFLOGM

INCLUDE 'DLG1.FD'

LOGICAL retlog

TYPE (DIALOG) thisdlg

...

retlog = DLGINIT (IDD_DLG3, thisdlg)

IF (.not. retlog) THEN

WRITE (*,*) 'ERROR: dialog not found'

ELSE

...

See Also