Createmediawex: The returned handle is 0, while getlasterror returns 0.

Source: Internet
Author: User

This is really strange. It is clear that createmediawex has failed, but it is followed by getlasterror but returns 0 to say it is successful. Fuck Widnows!

In fact, the window fails to be created because the registered window handler does not process messages sent to the window when several windows such as wm_create are created. In the window handler, defwindowproc () is called () done.

/////////////////
Haha ~~~~~ I finally called it out to announce the correct answer !!!
It turns out that wndproc has no write pair and does not process some system messages, such as wm_create ~
As long as wndproc is correctly handled, even if defwindowproc is called ~
You can use an export function to enter the main message loop ~
It is worth learning from. When createwindow returns NULL and getlasterror is normal, this problem should be solved!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.