Click here to Skip to main content
15,901,205 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: wm_create problems Pin
super_matt27-Oct-03 8:06
super_matt27-Oct-03 8:06 
GeneralRe: wm_create problems Pin
Jason Henderson27-Oct-03 9:54
Jason Henderson27-Oct-03 9:54 
GeneralRe: wm_create problems Pin
super_matt27-Oct-03 15:55
super_matt27-Oct-03 15:55 
GeneralRe: wm_create problems Pin
super_matt27-Oct-03 16:25
super_matt27-Oct-03 16:25 
GeneralRe: wm_create problems Pin
Jason Henderson27-Oct-03 16:54
Jason Henderson27-Oct-03 16:54 
GeneralRe: wm_create problems Pin
Anonymous28-Oct-03 7:18
Anonymous28-Oct-03 7:18 
GeneralRe: wm_create problems Pin
Jason Henderson28-Oct-03 8:24
Jason Henderson28-Oct-03 8:24 
GeneralRe: wm_create problems Pin
super_matt28-Oct-03 9:00
super_matt28-Oct-03 9:00 
this is my create window method:

bool GLWindow::CreateGLWindow(HINSTANCE hInstance //this is hInstance passed by WinMain)
{
ofstream emsg ("ERROR.txt"); //this is where i have been putting my errors
GLuint PixelFormat;
DWORD dwExStyle;
DWORD dwStyle;
RECT WindowRect;

WindowRect.left = (long)0;
WindowRect.right = (long)m_aResolution[0]; WindowRect.top = (long)0;
WindowRect.bottom = (long)m_aResolution[1];

m_hInstance = hInstance;
WNDCLASSEX l_wc =
{ sizeof(WNDCLASSEX),
CS_GLOBALCLASS | CS_HREDRAW | CS_VREDRAW | CS_OWNDC,
(WNDPROC) WndProc,
0,
0,
m_hInstance,
LoadIcon(NULL, IDI_WINLOGO),
LoadCursor(NULL, IDC_ARROW),
NULL,
NULL,
m_StrTitle,
LoadIcon(NULL, IDI_WINLOGO),
};


if (!RegisterClassEx(&l_wc))
{
emsg << GetLastError();
MessageBox(NULL,"Failed To Register The Window
Class.","ERROR",MB_OK|MB_ICONEXCLAMATION);
return FALSE;
}

/*********************************my class registers fine, no problem at all*********************/

dwExStyle=WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
dwStyle=WS_OVERLAPPEDWINDOW;

AdjustWindowRectEx(&WindowRect, dwStyle, FALSE, dwExStyle);

if (!(m_hWnd=CreateWindowEx(dwExStyle, m_StrTitle, m_StrTitle,
dwStyle |
WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
0, 0, WindowRect.right-WindowRect.left,
WindowRect.bottom-WindowRect.top,
NULL,
NULL, m_hInstance, this)))
{
/*************************************************************************************************
this is where the failure is, but the error code that gets printed is zero (which is enumerated as ERROR_SUCCESS) which i don't get at all, i don't know if i am somehow getting the wrong error code or what!!
*************************************************************************************************/
emsg << GetLastError();
emsg.close();
this->KillGLWindow();
MessageBox(NULL,"Window Creation Error","ERROR",MB_OK|MB_ICONEXCLAMATION);
return false;
}

****NOTE: i nocked off the rest of the code because it works, and it doesn't do anything but take up a lot of space in this post.

Your help so far has been great, thank you for your continued support
-Matthew
GeneralRe: wm_create problems Pin
Jason Henderson28-Oct-03 10:54
Jason Henderson28-Oct-03 10:54 
GeneralRe: wm_create problems Pin
yndfcd27-Oct-03 16:55
yndfcd27-Oct-03 16:55 
GeneralRe: wm_create problems Pin
super_matt28-Oct-03 7:47
super_matt28-Oct-03 7:47 
GeneralRe: wm_create problems Pin
yndfcd28-Oct-03 13:20
yndfcd28-Oct-03 13:20 
GeneralCMonthCalCtrl returns wrong date Pin
asierra27-Oct-03 7:56
asierra27-Oct-03 7:56 
GeneralRe: CMonthCalCtrl returns wrong date Pin
asierra27-Oct-03 12:46
asierra27-Oct-03 12:46 
GeneralAccounting Program Pin
Santiago Su♦rez27-Oct-03 7:23
sussSantiago Su♦rez27-Oct-03 7:23 
GeneralDon't EVER use the registry! Please Pin
wogerdoger27-Oct-03 6:32
wogerdoger27-Oct-03 6:32 
GeneralRe: Don't EVER use the registry! Please Pin
John M. Drescher27-Oct-03 7:06
John M. Drescher27-Oct-03 7:06 
GeneralRe: Don't EVER use the registry! Please Pin
ZoogieZork27-Oct-03 8:54
ZoogieZork27-Oct-03 8:54 
GeneralRe: Don't EVER use the registry! Please Pin
John M. Drescher27-Oct-03 9:03
John M. Drescher27-Oct-03 9:03 
GeneralRe: Don't EVER use the registry! Please Pin
Jörgen Sigvardsson28-Oct-03 10:34
Jörgen Sigvardsson28-Oct-03 10:34 
GeneralRe: Don't EVER use the registry! Please Pin
alex.barylski27-Oct-03 7:07
alex.barylski27-Oct-03 7:07 
GeneralRe: Don't EVER use the registry! Please Pin
John M. Drescher27-Oct-03 7:20
John M. Drescher27-Oct-03 7:20 
GeneralRe: Don't EVER use the registry! Please Pin
John M. Drescher27-Oct-03 7:10
John M. Drescher27-Oct-03 7:10 
GeneralRe: Don't EVER use the registry! Please Pin
David Crow27-Oct-03 7:21
David Crow27-Oct-03 7:21 
GeneralRe: Don't EVER use the registry! Please Pin
Maximilien27-Oct-03 7:35
Maximilien27-Oct-03 7:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.