Thread: Script errors - bool unrecognized and struct issues

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Math wizard
    Join Date
    Dec 2006
    Location
    USA
    Posts
    582
    It's initialized in the WinMain function. It's shown in the first post of this thread, flagged in red below:

    Code:
    ...
    if (!hwnd)
    		return 0;
    	done = false; // initialize loop condition variable
    	/* main message loop */
    	
    	[color:#ff0000]HDC_handle = GetDC(hwnd);[/color]
    	
    	draw_test_image();
    	
    	while(!done)
    	{
    		PeekMessage(&msg,hwnd,NULL,NULL,PM_REMOVE);
    ...l
    Note that it's above the function being called that has the image display stuff in it and thus it's initialized before the image drawing code function is called. Normally, as far as I know, instructions are processed top to bottom as humans would read a book and when a function call is present, the instructions of that function are processed top to bottom then when the function is done, the function that called it continues on which then goes into the loop that causes 100% CPU usage making everything go slowly (the image drawing stuff is done before this loop even starts). I should try putting a pause of one second before that loop starts to see if the extreme CPU usage from that loop is causing problems. Fixing this is, at the moment, outside my knowledge as I don't know what this "message" stuff is.

    Edit: Never mind - I found the cause - the pointers for the bitmap data was not set for some reason. I did a little debug test combining sprintf() with the MessageBox function and found that the pointers for bmp_head_pointer and bmp_image_pointer were equal to zero, the null value, and thus pointing to nothing. I set the pointers and saw nonzero values and when I cleared my debug message box, the image displayed just as I expected it to. Now to move on to other tasks.... Thanks for the assistance.
    Last edited by ulillillia; 12-18-2006 at 05:26 AM. Reason: Issues resolved - pointers not set

Popular pages Recent additions subscribe to a feed