3.42 DM_LoadDialog

Using this function dialogs can be loaded into the application.

DM_ID DML_default DM_EXPORT DM_LoadDialog
(
  DM_String path,
  DM_Options options
)

Parameters

-> DM_String path

Specifies the file to be loaded by means of a path. As is usual with all file accesses, the indicated name has to have the following structure:

environment variable:name of dialog file

The preceding environment variable serves as path on which the dialog file is to be searched.

-> DM_Options options

This parameter is reserved for future versions. Please specify with 0.

Return Value

0

The indicated file is not an error-free DM file, or the file was not found.

!= 0

Identifier of the dialog loaded by DM.

The DM has the ability to load the dialog data from an ASCII file (dialog script) as well as from a binary file. The main advantage of a binary file is that it can be loaded in a significantly shorter time, because no internal checks have to be carried out. A binary file is generated with this command:

idm +writebin <name of binary file> <name of ASCII file>

Example

Excerpt from an AppMain function:

  /*

  ** Loading the dialog. Standard name is given in the

  ** program, and can be overwritten via the command line.

*/

  switch(argc)

  {

    case 1:

        dialogID = DM_LoadDialog (dialogfile, 0);

    break;

    case 2:

        dialogfile = argv[1];

        dialogID = DM_LoadDialog (dialogfile, 0);

    break;

    default:

        DM_TraceMessage("Zuviele Argumente ",

            DMF_LogFile | DMF_InhibitTag);

    return(0);

    break;

  }

 

  if (!dialogID)

  {

    DM_TraceMessage("%s: Could not load dialog \"%s\"",

            DMF_LogFile | DMF_InhibitTag | DMF_Printf,

            argv[0], dialogfile);

    return(1);

  }

See Also

Built-in function load() in manual “Rule Language”