LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Loading UIR panels in a DLL that are embedded in another DLL

Presently I have the following scheme working : 2 DLLS,   DLL2 creates the main GUI.   DLL1 calls DLL2 to add an easyTab panel w/callback, both located in DLL1.  The DLL1 panel exists in an external .UIR file.
 
DLL1 calls DLL2 as such:
 
  // Add our customizations to the base GUI by calling the DLL2 exported function   addModuleTabPanel()
  addModuleTabPanel("Core_UIR.uir";CORE_PANEL,__CVIUserHInst);
 
DLL2 has this code for this function :
 
  /* Done at DLL2 init time */
  char *uir_file = "GUI_UIR.uir";
  sysIntPanel = LoadPanelEx (0,uir_file, SYS_PANEL,__CVIUserHInst);
  moduleTabCtrl = EasyTab_ConvertFromCanvas (sysIntPanel, SYS_PANEL_CANVAS_MODULE_TABS);
 
  int DLLEXPORT addModuleTabPanel(char *uir_file, int panel_id, void *modHandle)
  {
    int panelHandle;
    panelHandle = LoadPanelEx (sysIntPanel, uir_file, panel_id, modHandle);  // Load panel located in DLL1
    EasyTab_AddPanels (sysIntPanel, moduleTabCtrl, 1, panelHandle, 0);
    return(panelHandle);
  }

This works fine. Now I want to remove the dependency on DLL 1's external UIR file and embed it in DLL1.  Since DLL 2 is currently loading the panel by referencing the external UIR on the hard disk, when this external UIR file no longer exists , how can I get DLL2 to load it?  Loading the panel requires calling the new load function in DLL1 rather that LoadPanelEx. Should I load the panel in DLL1 and pass the panel handle into DLL2 of should I pass DLL2 a pointer to the load function in DLL1? Can this even be done with an embedded panel?
Thanks alot
Jeff McCracken
 
0 Kudos
Message 1 of 2
(3,258 Views)

Hello Jeff,

According to the help documentation for embedding project UIRs in DLLs- Enabling this option allows you to ship only the DLL, instead of including the .uir files also. You must call LoadPanelEx with a valid calling module handle to load an embedded .uir file from a DLL. Make sure that you include all .uir files loaded through LoadPanelEx in your project if you want to ship only the DLL file. If you pass an absolute filename to LoadPanelEx, the function will always look on disk for the .uir file. If you pass a simple filename, LoadPanelEx will look first for an embedded .uir.

So, if you pass the simple file name to DLL2, it should first search for the UIR within DLL1.
 
Hope that helps.
Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 2 of 2
(3,231 Views)