LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Unknown Error - NON-FATAL RUNTIME Error

Hello Friends,

 

I am getting a non fatal runtime error shown below in the image. Can anyone tell what am I doing wrong. I am also going to explainthe situation below the image.

NonFatal.PNG

In the main function I am calling loadDefaultFile() function which loads an XML file stored in the Working folder.

Also in my menubar I have an option of including another XML. At the start of the GUI the stored XML file is loaded. No problem till this point. But when I try to import another XML the above error occours.

The situation is best explained in the code below:

 

//============== Important is to know the loadDefaultFile() function call ============//

int main (int argc, char *argv[])
{
    int error = 0;
    
    /* initialize and load resources */
    nullChk (InitCVIRTE (0, argv, 0));
    errChk (panelHandle = LoadPanel (0, "PintschBamag.uir", PANEL));
    
    /* display the panel and run the user interface */
    errChk (DisplayPanel (panelHandle));
    loadDefaultFile();
    errChk (RunUserInterface ());

Error:
    /* clean up */
    if (panelHandle > 0)
        DiscardPanel (panelHandle);
    return 0;
}

 

// Automatic calling at the start of GUI

void loadDefaultFile()
{
    //*path = "XML.xml";
    GetElements("XML.xml");
}

 

// This function is to be called when importing another XML (error occours here)

void CVICALLBACK loadNewXML (int menuBar, int menuItem, void *callbackData,int panel)
{
     if (VAL_EXISTING_FILE_SELECTED == FileSelectPopupEx (EMPTY_STRING, XML_FILE_EXTN,
           XML_FILE_EXTN, XML_FILE_DLG_TITLE, VAL_SELECT_BUTTON, 0, 0, path))   // no &
           {
            GetElements(path);
           }
}

 

I hope someone can help me on this by understanding the situation.

 

Thanks,

Raunak

 

 

0 Kudos
Message 1 of 2
(3,243 Views)

Try initializing your thread to apartment-threaded before calling FileSelectPopup, using the following call:

 

CA_InitActiveXThreadStyleForCurrentThread (0, COINIT_APARTMENTTHREADED);

0 Kudos
Message 2 of 2
(3,216 Views)