将子窗体设为child,none,然后再主窗体中以创建动态窗口的方法显示就可以了
mytest *ptr;//子窗口类
ptr=new mytest();
ptr->Create(IDD_MYTEST_DIALOG, this);
CRect test;
this->GetClientRect(&test);
CRect wy;
ptr->GetClientRect(&wy);
test.left+=10;
test.top+=100;
test.right=test.left+wy.Width();
test.bottom=test.top+wy.Height();
ScreenToClient(test);
ptr->MoveWindow(&test);
ptr->ShowWindow(SW_SHOW);