Click here to Skip to main content
16,006,006 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to get the icon index by a file's extension Pin
David Crow11-May-05 8:31
David Crow11-May-05 8:31 
GeneralRe: how to get the icon index by a file's extension Pin
NPDemon11-May-05 8:52
NPDemon11-May-05 8:52 
GeneralRe: how to get the icon index by a file's extension Pin
NPDemon11-May-05 8:59
NPDemon11-May-05 8:59 
GeneralToolbar resolution Pin
wrykyn11-May-05 8:23
wrykyn11-May-05 8:23 
GeneralRe: Toolbar resolution Pin
Mohammad Tarik11-May-05 11:57
Mohammad Tarik11-May-05 11:57 
GeneralCan´t use OpenGL inside a thread Pin
arturapps11-May-05 7:37
arturapps11-May-05 7:37 
GeneralRe: Can´t use OpenGL inside a thread Pin
Ryan Binns11-May-05 18:03
Ryan Binns11-May-05 18:03 
GeneralRe: Can´t use OpenGL inside a thread Pin
cmk12-May-05 20:57
cmk12-May-05 20:57 
I do this in one of my OpenGL window classes as well.

First you must/should do the following when:
registering the window class:
- add CS_OWNDC | CS_HREDRAW | CS_VREDRAW styles
- set hbrBackground to NULL
creating the window:
- add WS_CLIPCHILDREN | WS_CLIPSIBLINGS styles.
using the window:
- handle WM_ERASEBKGND and return true
- handle WM_WINDOWPOSCHANGED when !(flags & SWP_NOSIZE) to update the viewport

There can be any number of things wrong.
A couple of the more common are:
- the DC and RC must stay current to the rendering thread while rendering (i.e. the app thread can't use the DC/RC without some syncing with the render thread). generally you get the DC right after the window is created, get an RC for the DC, and keep hold of both until the window is destroyed.
- because the window is created by the app thread it gets the WM_PAINT msg. at some point before you return (true) you should call ::ValidateRect() to clear the WM_PAINT msg. if you don't call this, and return false, the default paint handler will paint with the background brush.


...cmk

Save the whales - collect the whole set
GeneralThank you people Pin
arturapps13-May-05 3:42
arturapps13-May-05 3:42 
GeneralAbort Pin
Anonymous11-May-05 6:48
Anonymous11-May-05 6:48 
GeneralRe: Abort Pin
BlackDice11-May-05 6:49
BlackDice11-May-05 6:49 
GeneralRe: Abort Pin
Anonymous11-May-05 6:53
Anonymous11-May-05 6:53 
GeneralRe: Abort Pin
David Crow11-May-05 7:22
David Crow11-May-05 7:22 
GeneralRe: Abort Pin
Anonymous11-May-05 7:43
Anonymous11-May-05 7:43 
GeneralRe: Abort Pin
David Crow11-May-05 7:46
David Crow11-May-05 7:46 
GeneralRe: Abort Pin
Ansari A. Halim11-May-05 7:48
Ansari A. Halim11-May-05 7:48 
GeneralRe: Abort Pin
Anonymous12-May-05 6:40
Anonymous12-May-05 6:40 
GeneralQuestion re: overriding functions and default arguments Pin
Budric B.11-May-05 6:10
Budric B.11-May-05 6:10 
GeneralRe: Question re: overriding functions and default arguments Pin
David Crow11-May-05 6:14
David Crow11-May-05 6:14 
GeneralRe: Question re: overriding functions and default arguments Pin
S. Senthil Kumar11-May-05 7:03
S. Senthil Kumar11-May-05 7:03 
GeneralRe: Question re: overriding functions and default arguments Pin
Ansari A. Halim11-May-05 8:07
Ansari A. Halim11-May-05 8:07 
GeneralRe: Question re: overriding functions and default arguments Pin
Ryan Binns11-May-05 18:09
Ryan Binns11-May-05 18:09 
GeneralDLL and CTypedPtrList problem Pin
Andrew Hoole11-May-05 5:38
Andrew Hoole11-May-05 5:38 
GeneralRe: DLL and CTypedPtrList problem Pin
David Crow11-May-05 6:19
David Crow11-May-05 6:19 
GeneralRe: DLL and CTypedPtrList problem Pin
Andrew Hoole11-May-05 21:37
Andrew Hoole11-May-05 21:37 

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.