本文介绍了在对话框应用程序中打印多点触控编辑框内的钢琴键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 1)我们之前使用的是带有对象的CMIDI类, CMidiKeyboard m_Keys; 该对象作为控件传递给DDX,与IDC_EDIT1链接, DDX_Control(pDX,IDC_EDIT1,m_Keys); 该对象用于初始化CMIDIKeyboard, m_Keys.Initialize( CMIDIKeyboard :: LOW_NOTE,CMIDIKeyboard :: HIGH_NOTE); 用于在编辑框上绘制键盘。 2)对于Multitouch-我们创建了CEditPiano,它有一个对象, CEDitPiano m_Keys1; 也通过DDX控件链接到另一个示例编辑框, DDX_Control(pDX,IDC_EDIT4,m_Keys1); 用于注册触摸窗口, M_Keys1.RegisterTouchWindow(); > ISSUE - 用于多点触控的对象启动类似 CEDitPiano m_Keys1; 和用于绘制钢琴的对象就像 CMidiKeyboard m_Keys; so ,要将PianoKeys包含在多点触控EditBox中,我们需要初始化 m_Keys1.Initialize(CMIDIKeyboard :: LOW_NOTE,CMIDIKeyboard :: HIGH_NOTE); 但 m_Keys1不是CMIDIKeyboard的对象,所以由于不兼容我们 无法初始化键盘。 如何在多点触控编辑框中实现钢琴初始化。 解决方案 您遗漏了一个重要部分,即您在此处列出的对象的类层次结构。例如,CMidiKeyboard和CMIDIKeyboard类(结构体?命名空间?)之间的关系是什么?他们从中得到什么? 1)Earlier we are using- a CMIDI Class with an object,CMidiKeyboard m_Keys;that object is passed as control to the DDX ,linking with IDC_EDIT1,DDX_Control(pDX, IDC_EDIT1, m_Keys); the object is used to initialize the CMIDIKeyboard ,m_Keys.Initialize(CMIDIKeyboard::LOW_NOTE, CMIDIKeyboard::HIGH_NOTE); which is used to draw Keyboard on edit box .2)For Multitouch- we created CEditPiano which has an object,CEDitPiano m_Keys1;which is also linked with another sample edit box through DDX control,DDX_Control(pDX, IDC_EDIT4, m_Keys1);which is used to register touch window,M_Keys1.RegisterTouchWindow();after detecting WM_TOUCH message, Multitouch is detected on touch, in CEditPaino.cpp Class and Multitouch is printed.ISSUE-the Object used for Multitouch is initiased LikeCEDitPiano m_Keys1;and Object for drawing piano is initiased likeCMidiKeyboard m_Keys;so,to include PianoKeys inside a multitouch EditBox we need to Initialsem_Keys1.Initialize(CMIDIKeyboard::LOW_NOTE, CMIDIKeyboard::HIGH_NOTE);Butm_Keys1 is not object for CMIDIKeyboard so due to incompatibility we arenot able to initialise Keyboard.How to achive Piano Initialization in Multitouch editbox. 解决方案 You left out an important part, namely the class hierarchy of the objects you list here. What is the relationship between the CMidiKeyboard and CMIDIKeyboard classes (structs? namespaces?) for example? What do they derive from? 这篇关于在对话框应用程序中打印多点触控编辑框内的钢琴键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-29 22:50