我有以下代码的问题:
class MainWindow { ... private: bool CreateWindow(std::string, int, int, int, bool); ... }
和
bool MainWindow::CreateWindow(std::string title, int width, int height, int bits, bool fullscreen) { ...
Visual Studio突出显示了以下错误的方法定义:
int reateWindow(std::string title, int width, int height, int bits, bool fullscreen) Error: class "MainWindow" has no member called "CreateWindowExW"
编译器输出如下内容:
warning C4003: not enough actual parameters for macro 'CreateWindowW' error C2039: 'CreateWindowExW' : is not a member of 'MainWindow'
我注意到,如果我将方法名称更改为其他名称,并不以大写字母C开头,则错误消失。 我是Windows开发新手。 是什么赋予了?
这只是因为CreateWindow
是由Microsoft创建的宏…它在WinUser.h
定义。