RegisterClassEx崩溃 – C ++

我正在开发Windows库,我是新手,但是我得到一个错误,我已经足够了,我不知道发生了什么事情。

这是我的代码:

LRESULT CALLBACK WbWindow::st_wind_callback(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam) { // Code for the callback static function return 0; } WbWMResult WbWindow::Create() { // Put in the class values for our window class_window_instance.cbSize = sizeof(WNDCLASSEX); class_window_instance.lpfnWndProc=WbWindow::st_wind_callback; class_window_instance.lpszClassName = window_name; class_window_instance.style = NULL; class_window_instance.cbClsExtra = 0; class_window_instance.cbWndExtra = 0; class_window_instance.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); class_window_instance.hCursor = LoadCursor(NULL, IDC_ARROW); class_window_instance.hIcon = LoadIcon(NULL, IDI_APPLICATION); class_window_instance.hIconSm = LoadIcon(NULL, IDI_APPLICATION); class_window_instance.hInstance = main_instance; class_window_instance.lpszMenuName = NULL; if(!RegisterClassEx(&class_window_instance)){ MessageBox(0,"There was an error registering the window-classname.","Critical Error!",MB_ICONSTOP | MB_OK); return WBE_CLASSREG; } window_instance = CreateWindowEx(WS_EX_STATICEDGE,window_name,window_title,WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,window_width,window_height,NULL,NULL,main_instance,NULL); if(window_instance == NULL){ MessageBox(0,"There was an error creating a window.","Critical Error!",MB_ICONSTOP | MB_OK); return WBE_WINCREATION; } created = WbTrue; return WB_SUCCESS; } 

我得到的错误,这是从debugging器的错误:未处理的exception,它说这是一个错误的指针在.lpszMenuName的问题,但是在可能的例子中,我不知道为什么。

怎么回事,我该如何解决?
谢谢

lpszClassNamelpWindowName被定义为LPCSTR – 做window_name和window_title有有效的字符串值吗? 他们在哪里定义?