本帖最后由 xianglitian 于 2010-04-09 09:31:44 编辑

解决方案 »

  1.   

    不董,呵呵,用clistctrl好像没有用过zeromemory
      

  2.   

    看了给出的代码,有问题的地方:
    pDC->SelectObject(GetStockObject(SYSTEM_FONT));
    这个需要保存返回值的,用完之后再SelectObject回去。
    另外,这句
    pDC->SelectStockObject(SYSTEM_FONT) ;
    没用过,不知道是不是需要注意。
    LZ先把这两句注释掉,看看有没有泄漏,就能确定是不是这两句代码的问题。
      

  3.   

    除了ls说的,还有你的GetStockObject()函数的调用,最后最好也DeleteObject()一下;MSDN原话
    Use the DKGRAY_BRUSH, GRAY_BRUSH, and LTGRAY_BRUSH stock objects only in windows with the CS_HREDRAW and CS_VREDRAW styles. Using a gray stock brush in any other style of window can lead to misalignment of brush patterns after a window is moved or sized. The origins of stock brushes cannot be adjusted. The HOLLOW_BRUSH and NULL_BRUSH stock objects are equivalent. The font used by the DEFAULT_GUI_FONT stock object could change. Use this stock object when you want to use the font that menus, dialog boxes, and other user interface objects use.It is not necessary (but it is not harmful) to delete stock objects by calling DeleteObject.