Im writing a DLL and trying to create a window. For some reason when I try the RegisterClass and CreateWindow calls CreateWindow fails with a "The system cannot find the file specified." error. I can't seem to figure out why? RegisterClassEx does pass, however.
Here is a code snippet of what Im doing.
// Needed because I can't access WinMain.
hInstance = (HINSTANCE)GetModuleHandle(NULL);
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = (WNDPROC)WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = NULL;
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = NULL;
wcex.lpszClassName = "Testing";
wcex.hIconSm = NULL;
MessageBox(NULL, "RegClass Failed", "Error", MB_OK);
hWnd = CreateWindow("Testing", "This is a test", WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);