编辑控件不会获得焦点! win32 c++
我的 Win32 应用程序中的编辑控件只是拒绝获得焦点!结果,我无法在其中输入文本。以前控制得好好的,现在就不行了! 这是代码的链接: http://dl.dropbox.com/u/35856163/src.zip
Edit Control's in my Win32 App just refuse to take focus!. As a result, I cannot enter text in them. The controls worked fine before, and now just refuse to work!
Here's a link to the code:
http://dl.dropbox.com/u/35856163/src.zip
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
下次在这里发布代码,至少尝试编译它!我在尝试编译你的文件时遇到了 18 个错误。你的代码也很难阅读,所以我不能真正说出在哪里发生了什么。您将字符与 wchars_t 混合,因此可能会导致内存损坏。
char Buffer[Length() + 1];
甚至不应该编译!你使用什么编译器?对于动态分配,必须使用指针和 new 关键字,不能使用数组下标来动态分配大小。无论如何,我也许知道问题出在哪里 - 你在 DispatchMessage 之前缺少 TranslateMessage。这会影响整个消息,你当然无法得到正确的消息。
Next time post code right here, and at least try to compile it! I get 18 errors just trying to compile your file. Your code is also very hard to read, so I can't really say what happens where. You are mixing chars with wchars_t thus you can have memory corruption.
char Buffer[Length() + 1];
shouldn't even compile! What compiler are you using? For dynamic allocation you MUST use pointers and new keyword, you can't use array subscript for dynamic size.Anyway I maybe know where the problem lies - you're missing TranslateMessage before DispatchMessage. That bugs whole message thing and you of course can't get correct messages.