示例ATL对话框窗口 [英] Sample ATL Dialog Window
本文介绍了示例ATL对话框窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人可以帮我找到一个有主窗口和一些组件的最新的,可运行的ATL项目吗?请为上帝的爱,不要告诉我使用WTL/Qt或其他.我需要ATL.没有关于它的最新项目.我只需要一个主窗口,仅此而已.我能找出其余的.
Can anyone help me find an up-to-date, working ATL project which has a main window and some components in it? Please, for the love of god, don't tell me to use WTL/Qt or others. I need ATL. There's no up-to-date project about it. I just need a main window, that's all. I can figure out the rest.
先谢谢了.
推荐答案
好的,为了上帝的爱:模板+对话框窗口中的Visual Studio 2010 C ++/ATL EXE项目.
OK, for the love of god: Visual Studio 2010 C++/ATL EXE project from template + dialog window.
来源:
- 跟踪: AtlDialogSample
- SVN: AtlDialogSample
- Trac: AtlDialogSample
- SVN: AtlDialogSample
这是您的主要兴趣所在:
This is of your primary interest:
////////////////////////////////////////////////////////////
// CMainDialog
class CMainDialog :
public CDialogImpl<CMainDialog>
{
public:
enum { IDD = IDD_MAIN };
BEGIN_MSG_MAP(CMainDialog)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
COMMAND_ID_HANDLER(IDCANCEL, OnCommand)
COMMAND_ID_HANDLER(IDOK, OnCommand)
END_MSG_MAP()
public:
// CMainDialog
// Window Message Handlers
LRESULT OnInitDialog(UINT nMessage, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
ATLVERIFY(CenterWindow());
return 0;
}
LRESULT OnCommand(UINT, INT nIdentifier, HWND, BOOL& bHandled)
{
ATLVERIFY(EndDialog(nIdentifier));
return 0;
}
};
和
VOID RunMessageLoop()
{
CMainDialog Dialog;
Dialog.DoModal();
}
这篇关于示例ATL对话框窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文