Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 1272: weird behaviour with NULLs
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

ivan
Ketchup Master

Russia
75 Posts

Posted - Oct 06 2004 :  09:15:45 AM  Show Profile
VS.net 2003 English; VA X 1272.

I have the following piece of code:


DWORD MtStatsUpdateThread::ThreadProc( LPVOID pData /*= NULL*/ )
{
	MtStatsUpdaterService * pService = reinterpret_cast<MtStatsUpdaterService*>( pData );

	InterlockedExchange( (LONG volatile*)&m_dwLastTick, GetTickCount() - 120000ul );

	WNDCLASS wc;
	ATOM atmClass;

	ZeroMemory( &wc, sizeof(wc) );

	wc.lpfnWndProc   = (WNDPROC)WindowProc;
	wc.hInstance     = GetModuleHandle(NULL);
	wc.lpszClassName = "wcIvMtStatsUpdater";

	atmClass = RegisterClass( &wc );

	HWND hWndUpdates = CreateWindow( wc.lpszClassName, "wndIvMtStatsUpdater", WS_POPUP, 
		CW_USEDEFAULT, CW_USEDEFAULT,
		CW_USEDEFAULT, CW_USEDEFAULT,
		NULL,
		NULL,
		GetModuleHandle(NULL),
		NULL );

	SetWindowLongPtr( hWndUpdates, GWLP_USERDATA, (LONG)(LONG_PTR)this );

// ... 


The problem is with the NULL marked in red. When I load the IDE and VA X finishes parsing files, it is black and not italic. The rest of the NULLs are correctly colored and italicized. There's more: if I put the cursor anywhere above the line containing 'GetModuleHandle(NULL)' argument, press shift and start extending the selection by pressing the down arrow, the NULL gets colored and italicized when the line with 'GetModuleHandle(NULL)' gets selected. Sometimes it stays that way when I remove the selection, sometimes it doesn't. If it stays colored/italicized it is enough to press pageup (to remove it from the view) and then pagedown to get it back in its 'unrecognized' state.

Edit: I forgot to mention that I had the same problem with build 1246.

Edited by - ivan on Oct 06 2004 09:19:16 AM

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Oct 09 2004 :  1:56:11 PM  Show Profile
i have seen odd effects like this before, but i have never had much success producing a good example, so i am pleased that i can reproduce this

case=364

zen is the art of being at one with the two'ness
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Oct 10 2004 :  6:11:59 PM  Show Profile
experimenting, i have found a smaller example

static void funWinNull()
{
    CreateWindow(
        NULL);
    SetWindowLongPtr(this);
}


vs

static void funWinNull()
{
    CreateWindow(NULL);
    SetWindowLongPtr(this);
}


it seems to be something about CreateWindow(), however you need the following call to SetWindowLongPtr to make it go wrong. most odd.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000