LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Panel does display on second run.

I have an CVI 6.0 application developed on an XP machine and running
on a 2000 machine. The app is launched from another CVI app. On the
first run of the system everything works fine. Main app launches sub
apps. When I end the sub app, return to the main app, and relaunch
the sub app, the sub app's panel doesn't display. The app is running
(I think) because I can see the app in the task bar. I have to right
click on the task bar entry and close the app. After a few tries like
this, the app will work. In some case the panel gets displayed but
the controls are not visible. Does anyone have some insight to what
might be going on and a possible solution.

Thanks.
Andy
0 Kudos
Message 1 of 6
(3,696 Views)
acrochet@hiwaay.net (Andy) wrote in message news:...
> I have an CVI 6.0 application developed on an XP machine and running
> on a 2000 machine. The app is launched from another CVI app. On the
> first run of the system everything works fine. Main app launches sub
> apps. When I end the sub app, return to the main app, and relaunch
> the sub app, the sub app's panel doesn't display. The app is running
> (I think) because I can see the app in the task bar. I have to right
> click on the task bar entry and close the app. After a few tries like
> this, the app will work. In some case the panel gets displayed but
> the controls are not visible. Does anyone have some insight to what
> might be going on and a possible sol
ution.
>
> Thanks.
> Andy

Sorry, subject should have read "Panel does NOT display on second run."
0 Kudos
Message 2 of 6
(3,696 Views)
Andy,

This is a very weird issue. Do you have any of the applications configured to be floating? you could load the panel for the second application as a dialog using InstallPopup() to make sure that it will be on top an modal. However the fact that sometimes it shows the panel but not the controls suggest there is some sort of conflict there. You may want to check the use of the processor, may be one of the 2 apps is using up the processor and is not allowing the other application to run properly.

Another thing to look for is any shared resources in these apps. There could be some sort of race condition causing this weird problem.

Please give us more details on what you app does to help you better.

I hope this helps.

Regards,

Juan Carlos
N.I.


P.S: Try not to answer you own questions in the forum since it appear as answered to everyone.
0 Kudos
Message 3 of 6
(3,696 Views)
If the second app is a dll that remains loaded in memory or an executable that is still loaded but limited to a single instance and called again, you may/probably need to free the component memory before you can create it again. Here is some code needed in a dll that shows a panel with a strip chart that is removed when the exported dll function is completed. NI .exe examples only show DiscardPanel(...) but the controls also must be discarded before new ones can be created by the dll.

DiscardPanel(SpectrumPanelHandle);
if (SpectPanelStripChart){
DiscardCtrl(SpectrumPanelHandle,SpectPanelStripChart);
SpectPanelStripChart = 0;
}
if(SpectrumPanelHandle){
DiscardPanel(SpectrumPanelHandle);
SpectrumPanelHandle = 0;
}
The preview pu
t an extraneous space in Chart. Hopefully the post won't do it but...
0 Kudos
Message 4 of 6
(3,696 Views)
OOPs, there's an extraneous DiscardPanel(...)
0 Kudos
Message 5 of 6
(3,696 Views)
After testing more in XP, the critical part for making the panel reload when it's exported function is called again is to add:

SpectrumPanelHandle = 0;
after:

DiscardPanel(SpectrumPanelHandle);

so that the previous instance of the panel is removed with:

DiscardPanel(SpectrumPanelHandle);
SpectrumPanelHandle = 0;
0 Kudos
Message 6 of 6
(3,696 Views)