Published by alax on 31 Dec 2006
How to customize OLE property frame window with ATL and WTL
Window API provides useful functions OleCreatePropertyFrame and OleCreatePropertyFrameIndirect, which allow easily to pop up object’s property pages, OLE property pages. The frame, however, is not customizable, does not even allows centering relative to parent’s window. COlePropertyFrameDialogT template class is to be a solution for this problem.
Additionally the template offers useful methods to discover available property pages from object’s ISpecifyPropertyPages interface, if available. With multiple objects you have a choice to show union of individual object’s pages, or intersection of the pages (that is show only pages supported by all provided objects).

Code excerpt:
CMyOlePropertyFrameDialog Dialog;
Dialog.SetObject(pSampleObjectUnknown);
// NOTE: This instructs dialog to query for proeprty pages from assigned object(s)
Dialog.SetObjectPages();
INT_PTR nDialogResult = Dialog.DoModal(m_hWnd);Â



