LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Why do two windows open?

Hello,


I apologize in advance for my English.

Do not you know why I'm going to open two windows when I run the program and select a language, and not just one one?

I do not know what to erase in order to open only one window from the correct language.

That's how I open up practically twice the program in classical language and the other in the selected language.
Progam is then loaded progressBar for a long time.

Thank you very much for your help.

Have a nice day
Majkl
 
 
 
0 Kudos
Message 1 of 7
(2,336 Views)

Why you see two instances of your panel is quite simple: you load the same panel (HL_PANEL) two times and display each instance. The first time in line 27 you load and localize the panel to your language, next you load it again in line 40 in native language.

After a bunch of customization, you display the panel in native language in line 188, next you display the localized instance in line 231. Get rid of the one you don't want and that's all.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 7
(2,322 Views)

Hi,

aha super, thank you very much!
So, just remove it (SHlPanel); ?
because I do not open it, but on the main panel I have two windows open.(annex)
So, what should I remove so I will not open it. ?
When I erased line 40, it would throw out the bug.
Thank you so much for your help.
 




0 Kudos
Message 3 of 7
(2,311 Views)

Now you must decide what to do in your application. You are loading the localized panel with 'panel' handle and the native, non-localized version with 'SHlPanel' variable. All customization is performed on the latter but the routine with the timer is called on the first one (lines 233­÷242). I suppose there is some code there you have not posted.

So you must decide whether you want the application to be localized or not and route all code to that direction: simply avoiding to load one instance of the panel without other code modifications will drive to compile and/or run-time errors.

 

As an alternative, you can have some configuration parameter that defines in which locale to run the application and develop your code on this framework:

// GetAppLanguage () may return a 'localized' flag that defines whether to run native or localized UI
GetAppLanguage (...);

if (localized) {
	GetLocalLanguageFilePath (...);
	LoadLocalizedPanel (..., &panel);
}
else
	panel = LoadPanel (...);

// Perform all customization on 'panel'
// Do other stuff if needed

// Display the user interface
DisplayPanel (panel);

 



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 7
(2,302 Views)

Thank you for answer.

I admit I will not program it for a long time, but I was given the task of modifying it to work.

This is where SHlPanel must stay, because almost the whole program is back on this declaration.

Also, as I released the program in the required language, the main window was in that particular language, but how much did I open the file from the file so I put it in the classical language.

So I do not know how to continue.

If I remove row 40, it writes an error.(annex)
0 Kudos
Message 5 of 7
(2,298 Views)

I'm not sure I understand exactly what you are saying, but if you don't need the panel in native language you should update the code related to 'panel' setting 'SHlPanel' instead and get rid of unwanted LoadPanel and DisplayPanel



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 6 of 7
(2,289 Views)

Yes you are right.

You need to delete one LoadPanel so I do not see two windows.
But I do not know which panel I should erase to avoid changing the code and the program worked.
Thank you for your help.
0 Kudos
Message 7 of 7
(2,217 Views)