在对话框应用程序中打印多点触控编辑框内的钢琴键

编程入门 行业动态 更新时间:2024-10-23 14:30:02
本文介绍了在对话框应用程序中打印多点触控编辑框内的钢琴键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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 Like

CEDitPiano m_Keys1;

and Object for drawing piano is initiased like

CMidiKeyboard m_Keys;

so,to include PianoKeys inside a multitouch EditBox we need to Initialse

m_Keys1.Initialize(CMIDIKeyboard::LOW_NOTE, CMIDIKeyboard::HIGH_NOTE);

But m_Keys1 is not object for CMIDIKeyboard so due to incompatibility we are not 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?

更多推荐

在对话框应用程序中打印多点触控编辑框内的钢琴键

本文发布于:2023-11-06 13:38:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1563840.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多点   对话框   应用程序   钢琴   编辑

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!