I really have no idea...help me

Hello everyone

I've just started to study OCC with Visual Studio 2005

I wanna make Dialog based MFC program.

I really don't know how to use OCC in dialog based.

If anybody have a example..

please send to me

uksama's picture
arkoala's picture

Member variables
private:
Handle(V3d_View) myView;
Handle(V3d_Viewer) myViewer;
Handle(Graphic3d_WNTGraphicDevice) myGraphicDriver;
Handle(AIS_InteractiveContext) myAISContext;

void CDialogBasedDlg::OnBnClickedButton()
{
myGraphicDriver = new Graphic3d_WNTGraphicDevice();
TCollection_ExtendedString viewerName("OCC Viewer");
myViewer= new V3d_Viewer(myGraphicDriver, viewerName.ToExtString());
myViewer->Init();

Handle(WNT_Window) hWnd = new WNT_Window(myGraphicDriver,GetSafeHwnd());
myView = myViewer->CreateView();

myView->SetWindow(hWnd);

myViewer->SetDefaultLights();
}

And only rest include used files.
Taken from any MDI sample. Unique trick is to use the whole window for rendering purpose passing the hWnd to OCC (GetSafeHwnd())

uksama's picture