Home

OFF-SOFT.net

OFF-SOFT.net

This site is support & information site of WEB,and Software. This site might help you that create software or Web Site…perhaps?[:]

From WTL to MFC (2) trap the wizard (dialog Chapter)

Published on| May 5th, 2009 | No Comment.
To close the MFC, WTL has been defined in the "COMMAND_HANDLER_EX" is used.
(atlclack.h MESSEJIMAPPUMAKURO Most are defined. )
Using it to make changes as follows.

[MainDlg.h Change]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
	BEGIN_MSG_MAP(CMainDlg)
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
			:
		COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
		//	add following line.
		//COMMAND_ID_HANDLER(IDC_BUTTON1, OnThankYou)
		COMMAND_HANDLER_EX(IDC_BUTTON1, BN_CLICKED,OnThankYou)
	END_MSG_MAP()
	:
	:
	LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
		//	replace following line.
//	LRESULT OnThankYou(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
	void OnThankYou(UINT uNotifyCode, int nID, CWindow wndCtl);

[MainDlg.cpp Change]
1
2
3
4
5
6
//LRESULT CMainDlg::OnThankYou(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
void CMainDlg::OnThankYou(UINT uNotifyCode, int nID, CWindow wndCtl)
{
	MessageBox("ThankYou");
//	return 0;
}

Trap Wizard (2)
And the following error while compiling.
error C3867: 'CMainDlg:: OnThankYou': There is no function call argument list. To create a pointer to the Members' & CMainDlg:: OnThankYou 'Please use the
error C2143: syntax error: '; 'A' break 'not before.
error C3861: 'COMMAND_HANDLER_EX': identifier not found
Was created by the wizard, by default, WTL header and do not capture the MESSEJIMAPPUMAKURO.

I will do in stdafx.h and add the following.
1
2
3
4
5
	:
#include <atldlgs.h>
//	add
#include <atlcrack.h>      // WTL enhanced msg map macros
	:

Okay and I OMOIKI This will output the following error when you run the compiled.
error C3861: 'SetMsgHandled': identifier not found
error C3861: 'IsMsgHandled': identifier not found

This is, WTL80 or problems? It is unknown, the map defined start, "BEGIN_MSG_MAP" rather than "BEGIN_MSG_MAP_EX" is a must use.
As far as the documentation is in, WTL7.0 later, "BEGIN_MSG_MAP" but "BEGIN_MSG_MAP_EX" There is also described as good, in fact, in accordance with the document notes that "BEGIN_MSG_MAP_EX" I do not have to be.

And to do this, you should complete the build.

Trap? Nothing that is not simple, and it has to鵜呑MI the wizard, when you customize, me, and I would appreciate you KUMITOっin the sense that I care.

In fact, WTL, not to use the Wizard, ATL and I can catch and keep the chaos to create a simple wizard screens.
MFC Wizard, after using the Wizard, MFC can use the most, WTL wizard is after using the Wizard, ATL and I have to get the most use That kind of power.

Comments

Leave a Reply







  • はてなブックマークへ追加する
  • Facebookでシェアする
  • twitter でつぶやく
  • Google Plusでシェアする
  • Pocketでシェアする
ページトップへ