Question


I need to build a control in MFC that shows previews of some files. These files are 3D models and so I need to use OpenGL to draw them and let the user interact with it (panning, zooming and so on).

I would like to extend CFileDialog class because it would be a waste of time to do the navigation in the file system again and the results would not be the same for sure.
I've managed to modify the CFileDialog resource adding my child dialog doing:

SetTemplate( 0, MAKEINTRESOURCE( IDD_MYPREVIEWDLG ) )

but the child is appended on the bottom part, while I would like to see my preview on right side.

Is that possible?

Was it helpful?

Solution

From MSDN (emphasis mine):

To make room for the new controls, the system expands the default dialog box by the width and height of the custom dialog box. By default, all controls from the custom dialog box are positioned below the controls in the default dialog box. However, you can override this default positioning by including a static text control in your custom dialog box template and assigning it the control identifier value of stc32. (This value is defined in the Dlgs.h header file.) In this case, the system uses the control as the point of reference for determining where to position the new controls. All new controls above and to the left of the stc32 control are positioned the same amount above and to the left of the controls in the default dialog box. New controls below and to the right of the stc32 control are positioned below and to the right of the default controls. In general, each new control is positioned so that it has the same position relative to the default controls as it had to the stc32 control. To make room for these new controls, the system adds space to the left, right, bottom, and top of the default dialog box as needed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top