First, design a set of base-class with standard inferface functions, they
are export base classes CStandardDoc, CChildFrame, CStandardView, and export
functions InitTemplate, GetModuleData. All embeded sub-modules' windows
classes and main module windows classes are derived from these base class.
At run time, all sub-modules' windows' View share the main module's Document
object, so the control and data exchange between sub-module and main module
or sub-module and sub-module are implemented by the Document in main module
and Views in sub-module. The CStandardDoc has the member function
GetMsgFromView to get information from sub-module View and use
UpdateAllView to broadcast the message to all View. The CStandardView has
the member function GetMsgFromDocument and OnUpdate for sub-modules' View
to receive message from the Document of main module.
This demo is a multimedia type Windows application, one main module, a bitmap
show sub-module, a simple math game module and a 3D animation mdoule. The
sub-modules are independent, they can be pluged in main module daymaniclly.
The config.exe in the demo allow the user decide which sub-module is embeded
to main module, which one not.