01-22-2010 01:42 PM
Im getting a error this error below FATAL RUN-TIME ERROR: "CIF_EVENT_LOG.c", line 112, col 30, thread id 0x00001B10: The program has caused a 'General Protection' fault at 001B:68561DF7.
why is that?
GetCtrlVal (panelHandle, CIF_PANEL_SCRIPTNAMESTRING, scriptName);
fpTextFile = fopen (scriptName, "r");
if (fpTextFile == NULL)
{
sprintf(statusMsg, "Error opening file %s", scriptName);
MessagePopup ("File Open Error", statusMsg);
}
else
{
while (fgets (sScriptLine, 256, fpTextFile) != NULL)
{
iScriptLine=atoi(sScriptLine);
if(iScriptLine == 3309)
{
MessagePopup("NEW EVENT", "--------------");
}
else
{
MessagePopup("WORD DISPLAY",(const char *)iScriptLine);********************* this is the error
}
}
fclose(fpTextFile);
}
break;
}
return 0;
}
01-23-2010 03:35 AM
What are you expecting to obtain by casting some (integer?) variable to a const char? You are very likely to get this type of errors in this case. Why not directly passing sScriptLine to MessagePopup? Alternatively, to examine the value of iScriptLine you will need to format it into a string to pass then to MessagePopup function.
(casting the address of iScriptLine to a char will result in obtaining the character whose value is stored in iScriptLine, but you will obtain meaningless results with your 3309 value. As an example, if iScriptLine == 65 then MessagePopup("WORD DISPLAY",(const char *)&iScriptLine); will result in a popup window with "A" as the message body)
01-25-2010 12:57 PM
Im recieving a application error when im trying to run my gui.exe on another computer that does have labwindows cvi, 0xc00000005.
at first its said add the cvirte.dll, the after i added the dll, intialization error. do