Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
H

hsuch

@hsuch
About
Posts
16
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How do I get the last LVN_ITEMCHANGED message?
    H hsuch

    Sorry, the owner-drawn style also generates a lot of messages. But the LVS_OWNDERDATA style always generates 3 messages each operation. I have improved my timer logic and it works fine right now. Thanks for your help.

    C / C++ / MFC help question

  • How do I get the last LVN_ITEMCHANGED message?
    H hsuch

    Well, because my drawing function always draw all selected objects, even only one object changes the state. ><" I'm trying to decrease the overhead. My idea is to draw as less as possible. I google around and find some solutions like to set a timer or to add the owner-draw style. Maybe that's the way to go.

    C / C++ / MFC help question

  • How do I get the last LVN_ITEMCHANGED message?
    H hsuch

    I click one item in the list-view control, hold down shift key, click another item, then I can select the items between the first and the last one. After that, I draw selection lines in another window for those items to indicate they are selected. Because I know windows will produce a bundle of messages to notify this operation, I draw my window just once after these messages to get better performance. "stop changing" ==> windows won't generate selection messages anymore for this operation Depending on windows' behavior, if there are few seconds between the messages, it should be the next selection operation. I know it is the first of the next group since it comes after my last timer event.

    C / C++ / MFC help question

  • How do I get the last LVN_ITEMCHANGED message?
    H hsuch

    Yes. It doesn't have the LVS_SINGLESEL style. That's why I think it is difficult to deal with. Right now I use a timer. I set a timer when I get the first message, after a short delay, I start to draw my window or something. If I handle each change message, my window will keep flashing during the processing. So I want to handle just once or in the last message. I'm looking for a better way to know when I get the last message. Thanks for your help.

    C / C++ / MFC help question

  • How do I get the last LVN_ITEMCHANGED message?
    H hsuch

    Do you mean the information in NM_LISTVIEW structure? I have monitored the messages. Some previous messages also have this state on, and the last one doesn't always has this state either.

    C / C++ / MFC help question

  • How do I get the last LVN_ITEMCHANGED message?
    H hsuch

    Hi all, When I select or deselect multiple items on ListView control, I will get a lot of LVN_ITEMCHANGED messages. The problem is, how do I get the last one only, or how do I know it is the last one? I want to modify my data after it stop changing. Thanks for your help.

    C / C++ / MFC help question

  • One line miss problem
    H hsuch

    Thanks for your help. I think it was useful and I'll try it. And, I also made one mistake: I used OWN_DC style for my window(I feel shame for it). I guess that's why I usually got incorrect clipping rectangles, since they were already rounded by windows.

    C / C++ / MFC question help

  • One line miss problem
    H hsuch

    Thanks for your help. I use memory DC to draw some bitmaps on the client area and offset the viewport origins (if I scroll the window). The line is actually the part of the bitmap around the edge of the client area. I didn't use any graphics techniques, just create a window and set mapping mode by SetMapMode(GetDC(hwnd), MM_ISOTROPIC), its extension by SetWindowExtEx(GetDC(hwnd), 100, 100, NULL) and SetViewportExtEx(GetDC(hwnd), 200, 200, NULL). After resizing the window, I got WM_PAINT messages. I analyze the invalidate rectangles, then found this problem. I use GDI, win32. Maybe no antialiasing. I'm not sure if it was double-buffering.

    C / C++ / MFC question help

  • One line miss problem
    H hsuch

    Hi, I want to do magnification on my window. I set the window extension to doubled. When I draw one line, actually it draws a 2-pixel line on the window. If that line is around the border of the window, it is possible only 1-pixel shown up. Now, if I size the window, windows doesn't invalidate the other pixel of that line which it thinks it was already shown. In other words, windows only invalidate the area by logical coordinate, it doesn't know there are some pixels in that coordinate are missed and need to invalidate again. How do I work it around? Thanks a lot.

    C / C++ / MFC question help

  • Loaded 'C:\WINDOWS\system32\version.dll', No symbols loaded
    H hsuch

    When I run my application, the output window give me: 'zw_gui2.exe': Loaded 'C:\WINDOWS\system32\version.dll', No symbols loaded. 'zw_gui2.exe': Unloaded 'C:\WINDOWS\system32\version.dll' 'zw_gui2.exe': Loaded 'C:\WINDOWS\system32\version.dll', No symbols loaded. 'zw_gui2.exe': Unloaded 'C:\WINDOWS\system32\version.dll' ... 'zw_gui2.exe': Loaded 'C:\WINDOWS\system32\version.dll', No symbols loaded. 'zw_gui2.exe': Unloaded 'C:\WINDOWS\system32\version.dll' Well, I know that, please just tell me once, don't say so many times! What are these messages? Can I turn it off? Thanks for your help. hsu

    C / C++ / MFC help question announcement

  • MDI maximized child bug
    H hsuch

    I read "Daniel Bowen, Creating a new MDI child: maximization and focus issues" and got some idea. I should handle redraw and focus issues. Set the client window as MDIS_ALLCHILDSTYLES style and change the function to :

    HWND child_createWnd(HWND hwndClient, int x, int y, int w, int h, TCHAR szCaption[], TCHAR szFilename[])
    {
    HWND hwndChild ;
    MDICREATESTRUCT mdicreate ;
    int fMax = 0;

    if(!childClass) childClass = zw\_child\_registerClass(); 
    
    mdicreate.szClass = szChildClass ;
    mdicreate.szTitle = szCaption ;
    mdicreate.hOwner  = GetModuleHandle(0) ;
    mdicreate.x       = CW\_USEDEFAULT ;
    mdicreate.y       = CW\_USEDEFAULT ;
    mdicreate.cx      = CW\_USEDEFAULT ;
    mdicreate.cy      = CW\_USEDEFAULT ;
    mdicreate.style   = `WS_OVERLAPPEDWINDOW | WS_CHILD | WS_CLIPSIBLINGS | WS_VSCROLL | WS_HSCROLL;`
    mdicreate.lParam  = (LPARAM)szFilename ;	
    
    `SendMessage(hwndClient, WM_SETREDRAW, FALSE, 0); /* Disable redraw */` 
    
    hwndChild = (HWND) SendMessage (hwndClient,
    	WM\_MDICREATE, 0,
    	(LPARAM) (LPMDICREATESTRUCT) &mdicreate) ; 
    
    	
    `/* Should maximize? */ 	SendMessage(hwndClient, WM_MDIGETACTIVE, 0, &fMax); 	fMax? ShowWindow(hwndChild, SW_MAXIMIZE) : ShowWindow(hwndChild, SW_NORMAL); 	 	/* Handle focus here */ 	SetFocus(hwndChild); 	 	/* Enable and redraw */ 	SendMessage(hwndClient, WM_SETREDRAW, TRUE, 0);  	RedrawWindow(hwndClient, NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN);`	
    
    
    return hwndChild;
    

    Right now everything is correct except very slow. If you have better idea, please let me know, thanks.

    C / C++ / MFC help c++ question

  • MDI maximized child bug
    H hsuch

    Hi all, It is very common to create a mdi child in a initially maximized state in some cases. I set SW_MAXIMIZE style in the MDICREATESTRUCT structure then send a message to mdi client window. After that, I saw twin sizing boxes on the top-right corner of my frame window (a pair of [Min][Max][Close] tri-buttons). If I restore the child window, the child got one and there was still one remaining on the corner. I was using Win32 SDK, not MFC. The code I used to create the child is like this:

    HWND child_createWnd(HWND hwndClient, int x, int y, int w, int h, TCHAR szCaption[], TCHAR szFilename[])
    {
    HWND hwndChild ;
    MDICREATESTRUCT mdicreate ;

    if(!childClass) childClass = zw\_child\_registerClass();
    
    mdicreate.szClass = szChildClass ;
    mdicreate.szTitle = szCaption ;
    mdicreate.hOwner  = GetModuleHandle(0) ;
    mdicreate.x       = CW\_USEDEFAULT ;
    mdicreate.y       = CW\_USEDEFAULT ;
    mdicreate.cx      = CW\_USEDEFAULT ;
    mdicreate.cy      = CW\_USEDEFAULT ;
    mdicreate.style   = WS\_VSCROLL | WS\_HSCROLL | WS\_MAXIMIZE; `//MAXIMIZE window style`
    mdicreate.lParam  = (LPARAM)szFilename ;
    
    hwndChild = (HWND) SendMessage (hwndClient,
    	WM\_MDICREATE, 0,
    	(LPARAM) (LPMDICREATESTRUCT) &mdicreate) ;
    
    return hwndChild;
    

    }

    I followed Petzold's sample code (cha18, Programming Windows 5ed.)to do this. I wander if I missed something. So I tried it on the sample code directly and add the flag to the style, but still happened. Did anyone ever get this problem? I'm very thankful if anyone can help me.

    C / C++ / MFC help c++ question

  • how can i pass my array object in function arguments by reference?
    H hsuch

    TagE the_array[20];
    void foo(TagE the_array[25]);?
    foo(the_array); //OK

    In this case, you can pass a pointer to the function.

    TagE the_array[20];
    void foo(TagE (&the_array)[25]);

    foo(the_array); //Error

    But in this case, you should pass a correct arrary to the function(TagE the_array[25];).

    C / C++ / MFC tutorial question data-structures help

  • illegal use of this type as an expression
    H hsuch
    class A
    {	
    	int x;
    };
    class B
    {	
    	template<class T> void temp(T* = NULL){}	
    	void test(void);
    };
    void B::test(void)
    { 	
    	temp<A>();  
    };
    

    Still doesn't work. :(

    C / C++ / MFC help c++ question

  • illegal use of this type as an expression
    H hsuch

    Sorry for missing the platform. I use VC6.0. I also try on VC Express, it is ok. So, it is compiler problem?

    C / C++ / MFC help c++ question

  • illegal use of this type as an expression
    H hsuch

    Hi all, I'm new to C++. I've a stupid problem. This is the code I used: class A { int x; }; class B { template<class T> void temp(void){ }; void test(void); }; void B::test(void) { temp<A>(); }; Why can't I compile this code? The error message is: test.cpp(23) :error C2275: 'A' : illegal use of this type as an expression test.cpp(23) : error C2059: syntax error : ')' If I move the template function temp() out from class B, then it is ok. Could someone help me? Thanks a lot.

    C / C++ / MFC help c++ question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups