LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Recallpanelstate

I tried to use Savepanelstate/Recallpanelstate but this error appear :
-14 Value is invalid or out of range.
 
What can i do to resolve this problem ? ( The panel saved has a lot of attribute...)
 
 
Thank you and sorry for my english !
0 Kudos
Message 1 of 5
(3,608 Views)

The obvious questions for us is what values did you use for PanleHandle and stateIndex on each of your calls?

Were they in the same block of code for visibility purposes (or global)?

Show us how you used these, and it may be easier to help you.

0 Kudos
Message 2 of 5
(3,606 Views)
I save the panel here :
 
int CVICALLBACK VALID_CB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
 switch (event)
  {
  case EVENT_COMMIT:
  SavePanelState (panelanaly, "file_CfgAnaly", 0);
  DiscardPanel (panelanaly);
  panelHandle = LoadPanel (0, "PanelHdev.uir", PANEL);
  DisplayPanel (panelHandle);
  LedPanel();
  CfgAnaly=1; 
  }
   return 0;
}
 
 
 
I recall it here :
 
void CVICALLBACK ANALYSEUR_CB (int menuBar, int menuItem, void *callbackData,  // GO sur panel de l'analyseur
  int panel)
{
 DiscardPanel (panelHandle);
 panelanaly = LoadPanel (0, "PanelHdev.uir", PANELANALY);
 DisplayPanel (panelanaly);
 if (CfgAnaly==1)
 {
 RecallPanelState (panelanaly, "file_CfgAnaly", 0);
 }
}
 
error when i recall the panel :
NON-FATAL RUN-TIME ERROR
  "Hdev.c", line 1041, col 5, thread id 0x000008F4
  Library function error (return value == -14 [0xfffffff2]).
  Value is invalid or out of range
 

Message Edité par Dreamtea le 07-04-2006 07:59 AM

0 Kudos
Message 3 of 5
(3,587 Views)

I put the same (or very similar) code into my project and it works just fine.  So the error must be something local to your application.

My advice, then, would be to make sure that   file_CfgAnaly  gets created in the first place.

After that, I would run debugger and check the value of  panelanaly after you load it but before you recall it.

Given none of those work, I would ask why you are discarding the panel and not just using the HidePanel command.

Sorry I can't be of more help than this.

0 Kudos
Message 4 of 5
(3,561 Views)
Hi,
 
I think that it would be helpfull to send a simple example where the problem appears.
 
Thanks in advance!
0 Kudos
Message 5 of 5
(3,529 Views)