Posting tweet...
前面的帖子《建立自己的消息循环》中提到使用从CCmdTarget派生的类作为消息传递的载体,但这种方法不能传递多余的参数(也许可以,但我不知道怎么搞:)。为了使这个机制支持大多数的消息,我把前面的例子改动了一下,把那些用于消息处理的类,改为从CWnd派生,然后再Create这些窗口。这样这些类其实就是个标准的窗口了,只是我没有把它们显示出来。
本例和前面的例子,主要用在那些多使用消息机制的Project中,其实也可以不必这么做,完全可以直接去调用类的方法。但是如果消息机制比较适合,此方法不失为一种选择。
点击这里下载Demo
Last Modified: Tuesday, May 22nd, 2007 @ 07:21
This entry was posted
on Tuesday, May 22nd, 2007 at 7:21 am and is filed under C++, Design Pattern.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
Google Stop Blog – Make a change is powered by WordPress and Minimalist Fever theme. Entries (RSS) and Comments (RSS).