PeekMessage的问题 [英] Problems with PeekMessage

查看:135
本文介绍了PeekMessage的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio 6和Windows XP下使用Visual C ++。我正在编写使用wav和mmio函数录制音频信号的软件,​​这似乎令人满意(Doc类中的录制和播放功能)。我添加了一个Stop
命令 这是为了停止录制过程。要允许处理与此命令关联的消息,我将重复调用Peekmessage,直到当前记录缓冲区已满。按下"停止"按钮后,将调用
OnStop命令处理程序(在Doc类中) 并且设置了停止标志,但是返回主录制节目是不可预测的。通常它可以正常工作,但同样经常它不会回到录音程序中它来自
的点。结果是打开的文件和硬件没有关闭,打开的无模式对话框也没有关闭。我已通过在调试中使用断点来建立此行为。我认为这个问题只是在添加
无模式对话框(用于查看录制进度)后才出现,但我不确定这一点。

I am using Visual C++ under Visual Studio 6 and windows XP. I am writing software to record audio signals using wav and mmio functions and this seems to work satisfactorarily(Recording and Playback functions in the Doc class). I have added a Stop command  which is intended to halt the recording process . To allow the message associated with this command to be processed I am repeatedly calling  Peekmessage until the current recording buffer is full. When the Stop button is pressed the OnStop command handler(in Doc Class) is called  and a Stop flag is set, but return to the main recording programme is unpredictable. Often it works OK but equally often it does not return to the point in the recording programme from which it came. The result of this is that open files and hardware do not get closed and also that open Modeless dialogs do not get closed either. I have established this behaviour by using breakpoints inside debug. I think the problem has only appeared since adding the Modeless Dialog(used to view recording progress) but I am not certain about this.

我不知道这是不是是一个错误或我是否错误地使用PeekMessage。

I do not know if this is a bug or whether I am using PeekMessage incorrectly.

推荐答案

你好BoatDev,

Hi BoatDev,

欢迎在这里。

您是否曾尝试使用GetMessage等待并获取消息?

Have you tried to use GetMessage to wait and get the meesage?

您介意显示相关代码吗?

Would you mind show your relevant code?

祝你有愉快的一天。

问候,


这篇关于PeekMessage的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆