本文介绍了使用MFC的Multitouch对话框应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在使用MFC Dialog开发Piano应用程序,我需要在其中使用Multitouch,到目前为止我看到的所有示例都是SDI/MDI的示例,其中包括在CChildView类中创建"OnCreate()"函数,由于CChildView不是在基于对话框的对话框中创建的,如何实现Multitouch? http://msdn.microsoft.com/en-us/windows7trainingcourse_win7multitouchgesturenative_topic2#_Toc243305418 [ ^ ]

我正在使用以下代码初始化我的应用程序

Hello ,I am developing a Piano application using MFC Dialog,I need to make use of Multitouch in it,all examples i have seen so far is of SDI/MDI which include creation of "OnCreate()" function in CChildView Class,as CChildView is not created in dialog based how to achieve the Multitouch? http://msdn.microsoft.com/en-us/windows7trainingcourse_win7multitouchgesturenative_topic2#_Toc243305418[^]

I am using the following code to initialize my app

BOOL CDemoApp::InitInstance()
{
	 
		AfxEnableControlContainer();
	// Standard initialization
	// If you are not using these features and wish to reduce the size
	//  of your final executable, you should remove from the following
	//  the specific initialization routines you do not need.
 
	Application *pApp = NULL;

	try {
		// Try an optional debug value to test an expired application ID:  
		// 	extern const ADP_APPLICATIONID ADP_EXPIRED_APPLICATIONID;
		//pApp = new Application(ApplicationId(0xAE395E85,0x332E49E4,0xA250C7B0,0x34F907BC));
		
	} catch (AdpException& e) {
		//cout << "The attempt to authorize the application failed!\n" << e.what() << endl;
		if (pApp != NULL)
		delete pApp;
		// Your code may choose to abort/exit here after informing the user of the situation
		MessageBox(NULL,"Application is not authorised to run on this machine, a valid Application ID is needed. Exiting....","sample app",MB_OK);
		ADP_Close(); //(comment this line to run the application without authorizing the application id)
		exit( -1 ); //(comment this line to run the application without authorizing the application id)
	}
	
	// ... Your code can continue..Normal operation continues here
	if (pApp != NULL) 
		delete pApp; 
		
 

	CSplashWindow::ShowSplashScreen();
	CDemoDlg dlg;
	m_pMainWnd = &dlg;
	 
	INT_PTR nResponse = dlg.DoModal();
 
	if (nResponse == IDOK)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with OK
	}
	else if (nResponse == IDCANCEL)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with Cancel
	}

	// Since the dialog has been closed, return FALSE so that we exit the
	//  application, rather than start the application's message pump.
	return FALSE;
}

推荐答案



这篇关于使用MFC的Multitouch对话框应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 20:26