Click here to Skip to main content
15,921,113 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMFC custom control OnPaint not called Pin
_rubinho_16-Jun-05 5:27
_rubinho_16-Jun-05 5:27 
GeneralRe: MFC custom control OnPaint not called Pin
Blake Miller16-Jun-05 5:30
Blake Miller16-Jun-05 5:30 
GeneralRe: MFC custom control OnPaint not called Pin
_rubinho_16-Jun-05 5:44
_rubinho_16-Jun-05 5:44 
GeneralRe: MFC custom control OnPaint not called Pin
Blake Miller16-Jun-05 5:48
Blake Miller16-Jun-05 5:48 
GeneralRe: MFC custom control OnPaint not called Pin
_rubinho_16-Jun-05 5:52
_rubinho_16-Jun-05 5:52 
GeneralRe: MFC custom control OnPaint not called Pin
Blake Miller16-Jun-05 6:00
Blake Miller16-Jun-05 6:00 
GeneralRe: MFC custom control OnPaint not called Pin
_rubinho_16-Jun-05 6:20
_rubinho_16-Jun-05 6:20 
GeneralRe: MFC custom control OnPaint not called Pin
Blake Miller16-Jun-05 6:33
Blake Miller16-Jun-05 6:33 
Do you have a static control or some other control on the resource dialog template that this 'custom control' will override?

If that is the case, then you need to also make sure you have 'subclassed' the instance of your MFC custom control so that it is 'attached' to the 'real window' of the control from the dialog template. If not, then in the OnInitDialog function you must 'create' the 'real' window for the custom control to use.

For example, suppose you already place a static frame control onto the dialog template with control identifier IDC_MYCSTMCTRL, and in the header file you have declared an instance of your custom control:

CMyCustomControl m_MyCustomControl1;

Then in the OnInitDialog you can call

m_MyCustomControl1.SubclassDlgItem(IDC_MYCSTMCTRL, this);

Which should attach the CWnd control instance to the 'real' window created from the dialog template.

If this were done by the ClassWizard, and placed into the DoDataExchange, it might look something like this:

DDX_Control(pDX, IDC_MYCSTMCTRL, m_MyCustomControl1);


GeneralRe: MFC custom control OnPaint not called Pin
_rubinho_16-Jun-05 22:26
_rubinho_16-Jun-05 22:26 
GeneralRe: MFC custom control OnPaint not called Pin
David Crow16-Jun-05 7:26
David Crow16-Jun-05 7:26 
GeneralRe: MFC custom control OnPaint not called Pin
_rubinho_16-Jun-05 22:28
_rubinho_16-Jun-05 22:28 
GeneralSubmittin HTML param to activeX control Pin
Mimmi51116-Jun-05 5:25
Mimmi51116-Jun-05 5:25 
Questionhow to MFC Browser helper object? Pin
ThinkingPrometheus16-Jun-05 5:08
ThinkingPrometheus16-Jun-05 5:08 
Generalpopup / context menu with titlebar Pin
reteid16-Jun-05 4:54
reteid16-Jun-05 4:54 
GeneralLM hashes Pin
Andrew Admire16-Jun-05 4:40
Andrew Admire16-Jun-05 4:40 
GeneralTrouble opening large file Pin
Camron16-Jun-05 4:24
Camron16-Jun-05 4:24 
GeneralRe: Trouble opening large file Pin
David Crow16-Jun-05 4:42
David Crow16-Jun-05 4:42 
GeneralRe: Trouble opening large file Pin
Camron16-Jun-05 5:26
Camron16-Jun-05 5:26 
GeneralRe: Trouble opening large file Pin
Camron16-Jun-05 5:32
Camron16-Jun-05 5:32 
GeneralRe: Trouble opening large file Pin
Graham Bradshaw16-Jun-05 5:28
Graham Bradshaw16-Jun-05 5:28 
GeneralRe: Trouble opening large file Pin
Camron16-Jun-05 5:53
Camron16-Jun-05 5:53 
Questionhow to add MFC CStatic to a ATL project? Pin
ThinkingPrometheus16-Jun-05 3:49
ThinkingPrometheus16-Jun-05 3:49 
AnswerRe: how to add MFC CStatic to a ATL project? Pin
John M. Drescher16-Jun-05 4:10
John M. Drescher16-Jun-05 4:10 
GeneralRe: how to add MFC CStatic to a ATL project? Pin
ThinkingPrometheus16-Jun-05 4:29
ThinkingPrometheus16-Jun-05 4:29 
GeneralRe: how to add MFC CStatic to a ATL project? Pin
James R. Twine16-Jun-05 8:28
James R. Twine16-Jun-05 8:28 

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.