动态创建ActiveX控件

竟然可以先在Dialog中画一个Group Box用于定位,程序运行起来后把它的位置信息放到rect中,就把它销毁了!
再后来,动态地创建了一个IE控件,位置呢就用rect。代码:











LRESULT CAboutDlg::OnInitDialog(...) { CWindow wndPlaceholder = GetDlgItem ( IDC_IE_PLACEHOLDER ); CRect rc; CAxWindow wndIE; // Get the rect of the placeholder group box, then destroy // that window because we don't need it anymore. wndPlaceholder.GetWindowRect ( rc ); ScreenToClient ( rc ); wndPlaceholder.DestroyWindow(); // Create the AX host window. wndIE.Create ( *this, rc, _T(""), WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN );
原文地址:https://www.cnblogs.com/huqingyu/p/46391.html