Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » How to apply Windows style in child dialog when this child dialog is in DLL. Collapse All
Subject Author Date
Henry Tso Jul 3, 2007 - 2:51 AM

Hi,

I want to do the following purpose.
1. I create a some dll project, each dll project include one child dialog resource.
2. I create a export function to do this child dialog creation.
3. In main program, I dymanic load this dll and call the export function to do child dialog creation.
4. After the program running, The main window with the specify Windows style (CExtPaintManagerOffice2007_R2_LunaBlue), but
the embedded child window that created from DLL without Windows style apply.

Can I apply the Windows style in this child dialog where it created from DLL ?

Technical Support Jul 3, 2007 - 7:41 AM

There are two solutions to what you want to achieve depending on if your DLLS should be used only in MFC/Prof-UIS-based executables (1) or they can also be used from a non-MFC based EXE (2).

1) Both the EXE and DLLs should use the same runtime library, MFC and Prof-UIS libraries configurations. If the DLLs should be loaded dynamically, you should use ::AfxLoadLibrary() MFC API instead of the ::LoadLibrary() Win32 API. All the Prof-UIS based windows and controls in this case have the same UI theme defined by the paint manager. Both the EXE and DLLs use the same copy of MFC and Prof-UIS libraries. Changing the current theme affects all the Prof-UIS controls both in the EXE and DLLs. This design is the most convenient and least problem prone.

2) All the DLLs should be MFC regular DLLs and linked with MFC and Prof-UIS statically. Each DLL has its own copy of Prof-UIS and the theme settings should be synchronized between them manually. Prof-UIS provides some basic APIs for theme synchronization in this case.