10-25-2013 02:07 AM
10-25-2013 02:07 AM
10-25-2013 02:08 AM
10-25-2013 02:17 AM
Adding a library to a project it's easy: go to Edit >> Add files to project >> Library menu function and find the correct library in CVI installation; you should find the library in <CVIdir>\SDK\Lib\msvc\ folder (or msvc64 if you are to create a 64-bit executable).
With reference to localization, I suggest you open a new thread.
In any case, which is the problem you are finding? Are you able to run the supplied example?
The instrument is located in <CVIdir>\toolslib\localui\ folder and you should be able to load it in the Instrument menu: did you succeed in doing so?
10-25-2013 04:55 AM
RE:
Adding a library to a project it's easy: go to Edit >> Add files to project >> Library menu function and find the correct library in CVI installation; you should find the library in <CVIdir>\SDK\Lib\msvc\ folder (or msvc64 if you are to create a 64-bit executable).
With reference to localization, I suggest you open a new thread.
In any case, which is the problem you are finding? Are you able to run the supplied example?
The instrument is located in <CVIdir>\toolslib\localui\ folder and you should be able to load it in the Instrument menu: did you succeed in doing so?
hi,thank you so much!
Yes,i have found that project,but that example shows that it will LoadLocalize before the program execute. I want it loadLocalize when my programrunning and the user can change the language at any time.
void CVICALLBACK menu_English_Select_Click (int menubar, int menuItem, void *callbackData, int panel) { char langFilePath[MAX_PATHNAME_LEN]; int appLanguage; int i,panelHandle_main, dialog, error = UIENoError; //if (InitCVIRTE (0, argv, 0) == 0) /* Needed if linking in external compiler; harmless otherwise */ //return -1; /* out of memory */ //if ((GetAppLanguage (&appLanguage)) < 0) //return -1; appLanguage = 1; //Can i do this? GetLocalLanguageFilePath (appLanguage, langFilePath); //if ((error = LocalizePanel (panelMain , langFilePath)) < 0)
//Below line: error always return -6000,not zero. why? if ((error = LoadLocalizedPanel (0, "test.uir", panelMain , langFilePath, &panelHandle_main)) < 0) { if (error == UIEFileWasNotFound) { char errBuf[ERR_MSG_LEN]; sprintf (errBuf, "Error loading panel. Cannot find the \nlanguage file \"%s\".", langFilePath); MessagePopup ("Error", errBuf); } //return -1; } DisplayPanel (panelHandle_main); }
10-25-2013 05:05 AM
That's why I suggested to open a new thread: we are going far away with respect to the original argument
Localizing the panel while the program i running means calling LocalizePanel on panels already present in memory. New panels can be loaded with LoadLocalizedPanel as shown in the sample project.
Note that as explained here by Luis G you are limited when using a localized program in that calling DefaultPanel or DefaultCtrl can in some case revert some controls to their original locale.