MFC开发ATCIVEX 控件如何能用Dialog作为界面啊
解决方案 »
- **按钮的问题,寻淫人指导迷津
- 如何在VC里引用SQL数据库文件
- recv(SOCKET s,char FAR *buf,int len,int flags)中的buf问题
- 帮改错!谢谢!
- 用ChangeDisplaySettings改变分辨率时如何不改变当前刷新率?
- MSChart控件问题,有谁可以解决此问题。
- 子线程数量上限的问题
- 使用SOCKET传输大量数据时,如何设置才最高效?
- 请教高手:向计算机发包,产生瞬间的流量
- 有谁可以帮我把这段Delphi的程序改成 C# 的程序?
- 关于EnumChildWindows的问题?
- 急问高手:用inet打开某网页,存放这个网页的服务器响应时间较长,在响应的中途我想使inet停止,应该如何??先谢谢高手了
Dialog frame as an ActiveX controlThis article was contributed by Petr Stejskal. I wanted to create a control which would behave as a dialog or formview (you can place controls here). There is a simple way to do it - to take advantage of ActiveX. Create a new MFC ActiveX ControlWizard workspace (no need to special options).
Insert a new dialog resource named IDC_MYDIALOG (check following: style - child, border - dialog frame, visible, control, static edge)
Insert a new MFC class named CMyDialog (base class CDialog)
Add CMyDialog m_MyDialog member to your CDialogCtrl header source (don't forget to add #include "MyDialog.h")
Using classwizard add a member function OnCreate (WM_CREATE)
int CDialogCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (COleControl::OnCreate(lpCreateStruct) == -1)
return -1; m_MyDialog.Create(IDD_MYDIALOG, this);
return 0;
}Modify the member function OnDraw (the dialog's size depends on the WIDTH and HEIGHT specified in the HTML file): void CDialogCtrl::OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
{
// TODO: Replace the following code with your own drawing code.
// pdc->FillRect(rcBounds, CBrush::FromHandle((HBRUSH)GetStockObject(WHITE_BRUSH)));
// pdc->Ellipse(rcBounds); m_MyDialog.MoveWindow(rcBounds, TRUE);
}To show the control in your browser use this simple HTML: <html>
<head>
<title>DialogControl</title>
</head>
<body>
<center>
<OBJECT ID="DialogControl" CLASSID="CLSID:insert here the GUID from ODL file"
HEIGHT=300 WIDTH=300>
</OBJECT>
</center>
</body>
</html>Last updated: 17 November 1998