RT is a headless non-interactive system. There really is no good reason
to have a user interface downloaded on an RT enviornment. If you want
to notify the system about some error or message, you can use the tcp
libraries to communicate with a client across the network. Or you can
print messages to the screen.
Include this function in your project
#include <windows.h>
typedef int (*RTPRINTF)(const char*);
int CVIFUNC_C RTprintf(const char * debugstring)
{
HINSTANCE hinstLib;
RTPRINTF rtprintf = NULL;
int returnresult = -1;
hinstLib = LoadLibrary("msvcrt");
// If the handle is valid, try to get the function address.
if (hinstLib != NULL)
{
rtprintf = (RTPRINTF) GetProcAddress(hinstLib, "printf");
// If the function address is valid, call the function.
if (NULL != rtprintf)
{
returnresult= rtprintf(debugstring);
}
// Free the DLL module.
FreeLibrary(hinstLib);
}
return returnresult;
}
Then if you want to use this instead of the default printf add the following to your C file
#ifdef _LINK_CVI_LVRT_
int CVIFUNC_C RTprintf(const char *, ...);
#define printf RTprintf
#endif
This way, printf will print messages to the RT console.
Bilal Durrani
NI