RE: ! Warning ! in Debug

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
.



Relevant Pages

  • Re: PSPICE A/D simulation problem
    ... I don't know what PSPICE reports, but the error report from ... WARNING: Less than two connections to node 1. ... Best regards, ...
    (sci.electronics.design)
  • Re: How to catch the colorindex in a series
    ... This is neat if series are Fill types but from the OP's original post he ... Regards, ... >> colorindex with xlautomatic, the colour is different. ... >>> apply the same colorindex as returned from the marker, ...
    (microsoft.public.excel.programming)
  • Small Claim Court Query - to Nospam
    ... After my original post to this group I recieved an email from ... with hotmail adding the warning: ... suspected the address was bogus, ...
    (misc.legal)
  • Re: emulators/vmware2 broken...
    ... Regards, ... Alexandre Biancalana wrote: ... > warning: `pte' might be used ...
    (freebsd-questions)
  • Re: Delta discontinuing parts for older tools...
    ... I purchased an item the other day, can't remember what it was but I do recall that the packaging had something similar to the following. ... "Attention this item may contain products that are considered harmful to your health in the State of California" ... depending on the product] products that are known by the state of California to cause cancer" This warning is getting out of control to the point that manufacturers are putting it on just about everything they sell. ...
    (rec.woodworking)