RE: ! Warning ! in Debug
- From: Robby <Robby@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 4 Mar 2006 09:16:27 -0800
Hi its Robby again...
Please excuse me for having used the word 'error' where it should of been
'warning' in my original post!
Thankyou!
--
Best regards
Robert
"Robby" wrote:
Hi,.
Please consider the following code:
===============================================
LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam)
{
HWND hwndRect;
HINSTANCE hInstance;
int cxClient, cyClient;
switch(message)
{
case WM_CREATE:
hInstance = (HINSTANCE) GetWindowLong(hwnd,GWL_HINSTANCE);
hwndRect = CreateWindow(TEXT("static"),NULL,
WS_CHILD | WS_VISIBLE | SS_WHITERECT,
0,0,0,0,
hwnd, (HMENU) 1,hInstance,NULL);
return 0;
case WM_SIZE:
cxClient = LOWORD(lParam);
cyClient = HIWORD(lParam);
MoveWindow(hwndRect,0,0,cxClient/2, cyClient,TRUE);
return 0;
=========================================
A warning is generated regarding the following line:
MoveWindow(hwndRect,0,0,cxClient/2, cyClient,TRUE);
Here is the error:
c:\_dts_programming\vc++\current\testing_code\cpz_code_testing_p385_colors1\colors1.cpp(72)
: warning C4700: local variable 'hwndRect' used without having been
initialized
I don't know, but isn't hwndRect initialized in the WM_CREATE message?
Can anyone tell me why I am getting this error. All posts gracefully
appreciated!
--
Best regards
Robert
- Prev by Date: #pragma comment( lib, <filespec> ): may <filespec> be a relative path?
- Next by Date: Re: #pragma comment( lib, <filespec> ): may <filespec> be a relative path?
- Previous by thread: #pragma comment( lib, <filespec> ): may <filespec> be a relative path?
- Next by thread: Re: ! Warning ! in Debug
- Index(es):
Relevant Pages
|