I have an MDI interface and one of my windows creates, whenever I try to create another it fails to create it. How do you find out what the error was, like why it didn't create the window, when you are using SendMessage(g_hMDIClient, WM_MDICREATE, 0, (LONG)&mcs);? All this message seems to return is NULL for failure or the handle to the new window created. Seems to be no in between, GetLastError() returned 0. I've even tried calling CreateMDIWindow() and I get the same response from the GetLastError() call.
Code:// creates a channel window void CreateChannelWnd(TCHAR *chan) { CHANNEL *channel; int err; MDICREATESTRUCT mcs; TCHAR buffer[201]; mcs.szTitle = chan; mcs.szClass = g_szChild; mcs.hOwner = g_hInst; mcs.x = CW_USEDEFAULT; mcs.cx = 600; mcs.y = CW_USEDEFAULT; mcs.cy = 500; mcs.style = MDIS_ALLCHILDSTYLES; channel = LoadChan(chan); if( channel == NULL ) { AppendText(status.Display, COLOR_RED, "\nERROR: Unable to read in channel data file."); SendPart(chan); return; } else { channel->hWnd = CreateMDIWindow(g_szChild, chan, MDIS_ALLCHILDSTYLES, CW_USEDEFAULT, CW_USEDEFAULT, 600, 500, g_hMDIClient, g_hInst, 0); if( channel->hWnd == NULL ) { SendPart(chan); err = GetLastError(); sprintf(buffer, "\nERROR: Unable to create channel window. (%d)", err); AppendText(status.Display, COLOR_RED, buffer); AddError(); return; } ShowWindow(g_hMDIClient, SW_SHOW); } }



LinkBack URL
About LinkBacks


