Click here to Skip to main content
15,897,891 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: Static controls transparency problem [modified] Pin
Michael Dunn6-Jan-08 12:09
sitebuilderMichael Dunn6-Jan-08 12:09 
GeneralRe: Static controls transparency problem Pin
mirano7-Jan-08 0:34
mirano7-Jan-08 0:34 
GeneralMSMQ Pin
shakumar_221-Jan-08 22:27
shakumar_221-Jan-08 22:27 
QuestionCInternetSession Assertion Failure Pin
İsmail Durmaz22-Dec-07 7:30
İsmail Durmaz22-Dec-07 7:30 
GeneralNamespace ATL Pin
Ju@ncho19-Dec-07 7:00
Ju@ncho19-Dec-07 7:00 
GeneralNeed to launch outlook Pin
SamuelHenderson18-Dec-07 5:37
SamuelHenderson18-Dec-07 5:37 
QuestionWhere did the WTL documentation project go? Pin
Perceptor18-Dec-07 3:33
Perceptor18-Dec-07 3:33 
GeneralA strange WTL-app debug/release problem [modified] Pin
T800G14-Dec-07 15:06
T800G14-Dec-07 15:06 
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:
<br />
class CMainFrame : public CFrameWindowImpl<CMainFrame >, public CUpdateUI<CMainFrame >,public CMessageFilter, public CIdleHandler, public C_ImgArchive<br />
{<br />
public:<br />
	DECLARE_FRAME_WND_CLASS(NULL, IDR_MAINFRAME)<br />
<br />
	CIAVView m_view;<br />
	CThumbView m_thumbview;<br />
<br />
	BEGIN_UPDATE_UI_MAP(CMainFrame)<br />
	END_UPDATE_UI_MAP()<br />
<br />
	BEGIN_MSG_MAP(CMainFrame)<br />
		MESSAGE_HANDLER(WM_CREATE, OnCreate)<br />
                .....<br />
		CHAIN_MSG_MAP(CUpdateUI<cmainframe>)<br />
		CHAIN_MSG_MAP(CFrameWindowImpl<cmainframe>)<br />
	END_MSG_MAP()<br />
<br />
....}<br />
<br />
//<br />
LRESULT CMainFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)<br />
{<br />
<br />
//create view#1<br />
m_hWndClient=m_thumbview.Create(m_hWnd, rcDefault, NULL,<br />
	WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | LVS_ICON |  LVS_SINGLESEL | WS_EX_COMPOSITED);<br />
<br />
//create view#2<br />
m_view_hWnd=m_view.Create(m_hWnd, rcDefault, NULL, <br />
	WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);<br />
<br />
//add thumbnail-list images here, or later, it's not important<br />
....<br />
}<br />
<br />
<br />
<br />
class CIAVView :   public CScrollWindowImpl<CIAVView ><br />
{<br />
public:	<br />
   DECLARE_WND_CLASS_EX(NULL, CS_HREDRAW | CS_VREDRAW, -1)<br />
	BEGIN_MSG_MAP(CIAVView)<br />
		MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)<br />
		...<br />
		CHAIN_MSG_MAP(CScrollWindowImpl<ciavview>)<br />
	END_MSG_MAP()<br />
<br />
	void DoPaint(CDCHandle dc); //I implement flicker-free draw here<br />
...<br />
}<br />
<br />
class CThumbView: public CDoubleBufferWindowImpl<CThumbView, CListViewCtrl><br />
public:<br />
	DECLARE_WND_SUPERCLASS(NULL, CListViewCtrl::GetWndClassName())<br />
<br />
	CImageList m_ImageListThumb;<br />
<br />
	BEGIN_MSG_MAP(CThumbView)<br />
                     ...		<br />
	END_MSG_MAP()<br />
...<br />
}<br />
<br />
</ciavview></cmainframe></cmainframe>


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 the first-in-order ID view.

If I drag it's contents out of the screen, it gets redrawn at those parts that go out of screen.
When there is just one wiev, there's no problems. There is another issue with thumbnails-list not displaying properly, but I circumvent it with showing/creating thumbview window first. (playing with WS_CLIPSIBLINGS or WS_CLIPCHILDREN doesn't have any effect, except not drawing anything where it should)

I seem to me that my "flicker-free" view window never receives WM_PAINT message in release version.

Is this somehow related to debugger-window-activations -stuff (I vaguely remember reading somewhere something like that)...?
I can provide full source code if neccesary.
modified on Friday, December 14, 2007 9:13:09 PM

GeneralRe: A strange WTL-app debug/release problem Pin
CPallini28-Dec-07 11:45
mveCPallini28-Dec-07 11:45 
QuestionWTL COM? Pin
Kuryn13-Dec-07 23:17
Kuryn13-Dec-07 23:17 
AnswerRe: WTL COM? Pin
George L. Jackson14-Dec-07 4:44
George L. Jackson14-Dec-07 4:44 
GeneralRe: WTL COM? Pin
Kuryn15-Dec-07 18:12
Kuryn15-Dec-07 18:12 
GeneralRe: WTL COM? Pin
George L. Jackson16-Dec-07 14:23
George L. Jackson16-Dec-07 14:23 
AnswerRe: WTL COM? Pin
led mike18-Dec-07 5:29
led mike18-Dec-07 5:29 
AnswerRe: WTL COM? Pin
Michael Dunn5-Jan-08 20:36
sitebuilderMichael Dunn5-Jan-08 20:36 
GeneralWindows Service Help [modified] Pin
narayanagvs10-Dec-07 19:02
narayanagvs10-Dec-07 19:02 
GeneralRe: Windows Service Help Pin
myshketer11-Dec-07 21:21
myshketer11-Dec-07 21:21 
GeneralRe: Windows Service Help Pin
led mike12-Dec-07 6:29
led mike12-Dec-07 6:29 
GeneralSeeking advice on proper use of some c/c++ stuff, on my code. [modified] Pin
Dexterus6-Dec-07 0:49
Dexterus6-Dec-07 0:49 
GeneralRe: Seeking advice on proper use of some c/c++ stuff, on my code. [modified] Pin
Dexterus6-Dec-07 0:52
Dexterus6-Dec-07 0:52 
GeneralVista's Explorer toolbar control Pin
yarp5-Dec-07 23:31
yarp5-Dec-07 23:31 
GeneralRe: Vista's Explorer toolbar control Pin
Michael Dunn6-Jan-08 11:20
sitebuilderMichael Dunn6-Jan-08 11:20 
GeneralRe: Vista's Explorer toolbar control Pin
yarp6-Jan-08 19:18
yarp6-Jan-08 19:18 
QuestionProlem with rich edit control. ITextService's TxGetNaturalSize doesnt give me the right value.. [modified] Pin
Arif Siddiquee5-Dec-07 1:25
Arif Siddiquee5-Dec-07 1:25 
QuestionContextMenu HWND in a Shell Extension Dll Pin
Jeffrey Walton30-Nov-07 23:45
Jeffrey Walton30-Nov-07 23:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.