The "Init()" function is called when sliceOmatic start. It is a good place to initialize any variables that you have in your DLL.
Syntax
extern "C" __declspec(dllexport) int Init(
void
)
Parameters
This function does not have a parameter.
Return value
The function returns 0 if an error occurred, 1 otherwise.
Remarks
This function is optional. If you do not have any initializations to do, you can omit it.
Requirements
Header:
sliceO_include.hpp
Library:
sliceO_Structures.lib
Example
|
...
// --- Normally, these static variable would be defined in "xxx_var.cpp".
// However, to make this example simpler we have defined them locally. ---
void *Demo_Var_Pointer ;
char *Demo_Var_String ;
// ----------------------------------------------------------------------------
//
// Function: Init
//
// Parameters: void
// Returns: (int) 0 if error
//
// This is called once at the beginning of the program to enable you
// to initialize your process if you need to.
//
// ----------------------------------------------------------------------------
extern "C" __declspec(dllexport) int Init( void )
{
Error_Fct( hwnd, ERROR_CODDE_TRACE_5, "Demo module: Init" ) ;
// --- Initialize some static variables ---
Demo_Var_Pointer = (void *) calloc( 100 ) ;
Demo_Var_String = (char *) strdup( "Demo String" ) ;
return( 1 ) ;
}
...
|
|
See also
Exit