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
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. A strange WTL-app debug/release problem [modified]

A strange WTL-app debug/release problem [modified]

Scheduled Pinned Locked Moved ATL / WTL / STL
announcementc++comgraphicsdebugging
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    T800G
    wrote on last edited by
    #1

    I encountered strange problem with WTL program I'm trying to make (please bear with me because I'm not a pro, programming is just my hobby). I'm trying to make a program to view any image directly from zip (something like CDisplay, but with FreeImage and ZipUtils). I reused code of a WTL Bitmap viewer example (from original WTL package). I'm switching 2 views in SDI application (see http://www.codeproject.com/KB/wtl/switchviews\_wtl.aspx), one flicker-free image display (generic view) and a CListViewCtrl thumbnails list (not a control in client, I use whole view#2 window). I build with VC8ExpressSP1 + Platform SDK2003R2 + WTL latest version. Essential code: class CMainFrame : public CFrameWindowImpl<CMainFrame >, public CUpdateUI<CMainFrame >,public CMessageFilter, public CIdleHandler, public C_ImgArchive { public: DECLARE_FRAME_WND_CLASS(NULL, IDR_MAINFRAME) CIAVView m_view; CThumbView m_thumbview; BEGIN_UPDATE_UI_MAP(CMainFrame) END_UPDATE_UI_MAP() BEGIN_MSG_MAP(CMainFrame) MESSAGE_HANDLER(WM_CREATE, OnCreate) ..... CHAIN_MSG_MAP(CUpdateUI) CHAIN_MSG_MAP(CFrameWindowImpl) END_MSG_MAP() ....} // LRESULT CMainFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { //create view#1 m_hWndClient=m_thumbview.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | LVS_ICON | LVS_SINGLESEL | WS_EX_COMPOSITED); //create view#2 m_view_hWnd=m_view.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN); //add thumbnail-list images here, or later, it's not important .... } class CIAVView : public CScrollWindowImpl<CIAVView > { public: DECLARE_WND_CLASS_EX(NULL, CS_HREDRAW | CS_VREDRAW, -1) BEGIN_MSG_MAP(CIAVView) MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground) ... CHAIN_MSG_MAP(CScrollWindowImpl) END_MSG_MAP() void DoPaint(CDCHandle dc); //I implement flicker-free draw here ... } class CThumbView: public CDoubleBufferWindowImpl<CThumbView, CListViewCtrl> public: DECLARE_WND_SUPERCLASS(NULL, CListViewCtrl::GetWndClassName()) CImageList m_ImageListThumb; BEGIN_MSG_MAP(CThumbView) ... END_MSG_MAP() ... } The problem is: in debug version all is fine with window redrawing but in release version my flicker-free window is never updated, even when it is

    CPalliniC 1 Reply Last reply
    0
    • T T800G

      I encountered strange problem with WTL program I'm trying to make (please bear with me because I'm not a pro, programming is just my hobby). I'm trying to make a program to view any image directly from zip (something like CDisplay, but with FreeImage and ZipUtils). I reused code of a WTL Bitmap viewer example (from original WTL package). I'm switching 2 views in SDI application (see http://www.codeproject.com/KB/wtl/switchviews\_wtl.aspx), one flicker-free image display (generic view) and a CListViewCtrl thumbnails list (not a control in client, I use whole view#2 window). I build with VC8ExpressSP1 + Platform SDK2003R2 + WTL latest version. Essential code: class CMainFrame : public CFrameWindowImpl<CMainFrame >, public CUpdateUI<CMainFrame >,public CMessageFilter, public CIdleHandler, public C_ImgArchive { public: DECLARE_FRAME_WND_CLASS(NULL, IDR_MAINFRAME) CIAVView m_view; CThumbView m_thumbview; BEGIN_UPDATE_UI_MAP(CMainFrame) END_UPDATE_UI_MAP() BEGIN_MSG_MAP(CMainFrame) MESSAGE_HANDLER(WM_CREATE, OnCreate) ..... CHAIN_MSG_MAP(CUpdateUI) CHAIN_MSG_MAP(CFrameWindowImpl) END_MSG_MAP() ....} // LRESULT CMainFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { //create view#1 m_hWndClient=m_thumbview.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | LVS_ICON | LVS_SINGLESEL | WS_EX_COMPOSITED); //create view#2 m_view_hWnd=m_view.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN); //add thumbnail-list images here, or later, it's not important .... } class CIAVView : public CScrollWindowImpl<CIAVView > { public: DECLARE_WND_CLASS_EX(NULL, CS_HREDRAW | CS_VREDRAW, -1) BEGIN_MSG_MAP(CIAVView) MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground) ... CHAIN_MSG_MAP(CScrollWindowImpl) END_MSG_MAP() void DoPaint(CDCHandle dc); //I implement flicker-free draw here ... } class CThumbView: public CDoubleBufferWindowImpl<CThumbView, CListViewCtrl> public: DECLARE_WND_SUPERCLASS(NULL, CListViewCtrl::GetWndClassName()) CImageList m_ImageListThumb; BEGIN_MSG_MAP(CThumbView) ... END_MSG_MAP() ... } The problem is: in debug version all is fine with window redrawing but in release version my flicker-free window is never updated, even when it is

      CPalliniC Online
      CPalliniC Online
      CPallini
      wrote on last edited by
      #2

      Have a look at http://www.flounder.com/debug_release.htm[^] :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      [my articles]

      In testa che avete, signor di Ceprano?

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

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