5

我对以下代码有疑问:

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 开发的新手。是什么赋予了?

4

1 回答 1

11

很简单,因为CreateWindow是微软创建的宏……它定义在WinUser.h.

于 2013-07-09T10:01:26.173 回答