Call this function in your application object’s InitInstance function to enable support for containment of OLE controls.
之前在程序中遇到个问题:别的OCX调用我DLL里面的窗口显示,窗口上也有OCX,此时窗口怎么也不显示出来;但是单独创建一个对话框程序调用该DLL却能显现;最后究其原因还是没有调用AfxEnableControlContainer();
得出结论:1.要想把控件或者窗体作为容器显示OCX得调用AfxEnableControlContainer();