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 General Discussion » The Implement of a Plug-in framework?! Collapse All
Subject Author Date
c y Mar 1, 2007 - 2:51 AM

We just try to implement a plug-in framework that use explicit loading Dll,we’ve already implemented a Demo by using the MFC without Prof-UIs.But when we try to do the same work with Prof-UIs,there are many problems according it just as below:
1.How to Create the Menu and ToolBar dynamically?
2.Could the windows which are created by the Plug-In can Dock ?
3.Can you provide us a demo for that implement?

Technical Support Mar 1, 2007 - 9:56 AM

First of all, we would recommend you create your plugin DLL as an MFC extension library. This would allow you to code MFC based classes in these DLLs and make them accessible from the main EXE module and from other DLLs. Besides you would not need to invoke the MFC state managing code (AFX_MANAGE_STATE()) at the beginning of each exported method/function. There is only one requirement for such a plugin DLL: it should be loaded using the MFC’s AfxLoadLibrary() API instead of LoadLibrary() API provided by Win32. Using MFC extension DLLs, you will be able to define some exported methods for creating CExtPopupMenuWnd, CExtToolControlBar and any other instances of Prof-UIS/MFC classes and simply return pointers to these objects. So the main EXE module will use the objects constructed in such DLLs as they are constructed in the main EXE module. This means you can simply create CExtToolControlBar toolbar objects in a plugin DLL and trean them in the main frame window as though they were created in main EXE module.