OMmain_init


Synopsis


For UNIX systems:
int OMmain_init(
int  argc,
char *  argv  );

For PC systems:
int OMmain_init(
HINSTANCE hInst,
HINSTANCE hPrevInst,
LPSTR CmdStr,
int CmdShow  );

Description

OMmain_init initializes the Object Manager. As part of the initialization, object libraries are loaded according to the templ.v file.

You call OMmain_init whenever you write your own C or C++ main function.

The arguments argc and argv specify command-line arguments. OMmain_init scans for and processes AVS/Express-specific arguments, such as -vcp. This routine notifies you about arguments that it does not understand. You should remove any arguments from argc and argv (or CmdStr for PC's) that are not recognized by AVS/Express before calling this routine.

PREinit and BASEinit

As part of using OMmain_init, you must create two functions, PREinit and BASEinit. OMmain_init calls PREinit before loading libraries and BASEinit after loading libraries.

You typically either create routines that are empty, or use functions generated for you in processname.c for a particular process.

The routines have the following prototypes:

void PREinit (int * argc ,  char * argv );
void BASEinit (int * argc ,  char * argv );

Notice that with PREinit and BASEinit the argc parameter is a pointer to an integer.

Arguments

argc

The number of arguments in argv .

argv

The argument vector.

Returned value

A VCP mode that can be submitted to a subsequent call to OMmain_loop. For example, if argv contains the -vcp argument, then OMmain_init returns OM_VCP_PRESENT.