为什么Visual C++正在更改我的方法的名称

Why is Visual C++ changing the name of my method?

本文关键字:方法 我的 Visual C++ 为什么      更新时间:2023-10-16

我对以下代码有问题:

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中定义。