The program works fine on my Win2k machine, but on Win95 the following happens:
I'm creating an app, creating the main window works fine, but when i try to create the child windows, the registerclassex function fails. GetLastError() returns 0.
Any clues??
Code for child window:
Code:
int questWnd(HINSTANCE hThisInstance, HWND hWndOwner){
WNDCLASSEX wincl; // Data structure for the windowclass
MSG messages;
if(!GetClassInfoEx(hThisInstance, "ddqWnd", &wincl)){ // Sjekk om klassen er registrert fra før
// The Window structure
wincl.hInstance = hThisInstance;
wincl.lpszClassName = "ddqWnd";
wincl.lpfnWndProc = formProc; // This function is called by windows
wincl.style = CS_DBLCLKS; // Catch double-clicks
wincl.cbSize = sizeof(WNDCLASSEX);
// Use default icon and mouse-pointer
wincl.hIcon = LoadIcon (NULL, IDI_ASTERISK);
wincl.hIconSm = LoadIcon (NULL, IDI_ASTERISK);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
wincl.lpszMenuName = NULL; // No menu
wincl.cbClsExtra = 0; /* No extra bytes after the window class */
wincl.cbWndExtra = 0; /* structure or the window instance */
/* Use Windows's default color as the background of the window */
wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
if(!RegisterClassEx(&wincl)){
achBuf=NEW char[100]; sprintf(achBuf, "GetLastError=%lu", GetLastError());b(achBuf);
return(0);
}
}