天天看点

MessageBox和::MessageBox的使用

今天使用MessageBox时发现参数错误,查阅博客发现MessageBox和::MessageBox两者参数数目不同,MessageBox是 CWnd 类的成员函数,不需要句柄参数,例如

MessageBox(_T("创建一个群?"),NULL,MB_OKCANCEL  );

:: MessageBox是windows全局函数,需要传入句柄。

::MessageBox(this->m_hWnd,_T("创建一个群?"),NULL,MB_OKCANCEL  )

借鉴博客:https://blog.csdn.net/weixin_33729196/article/details/85553441