Chapter 8 Utility Library
© National Instruments Corporation 8-41 LabWindows/CVI Standard Libraries
Parameters
Input hInstance void
pointer 0 if called from main.
hInstance if called from WinMain (first parameter).
hInstDLL if called from DllMain (first parameter).
argv string
array argv if called from main (second parameter).
Otherwise, 0.
reserved void
pointer Reserved for future use. Pass 0.
Return Value
status integer 1 indicates success.
0 indicates failure (probably out of memory).
Using this Function
The function should be called in your main, WinMain, or DllMain function. Which of these
three functions you are using determines the parameter values you should pass to InitCVIRTE.
The following examples show how to use InitCVIRTE in each case.
int main (int argc, char *argv[])
{
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */
/* your other code */
return 0;
}
int __stdcall WinMain (HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpszCmdLine,
int nCmdShow)
{
if (InitCVIRTE (hInstance, 0, 0) == 0)
return -1; /* out of memory */
/* your other code */
return 0;
}
int __stdcall DllMain (void *hinstDLL, int fdwReason,
void *lpvReserved)
{
if (fdwReason == DLL_PROCESS_ATTACH)
{
if (InitCVIRTE (hinstDLL, 0, 0) == 0)
return 0; /* out of memory */
/* your other ATTACH code */
}
else if (fdwReason == DLL_PROCESS_DETACH)
{