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

C / C++ / MFC

 
QuestionRe: Edit control Pin
David Crow11-Jun-07 6:02
David Crow11-Jun-07 6:02 
AnswerRe: Edit control Pin
tom groezer11-Jun-07 6:08
tom groezer11-Jun-07 6:08 
QuestionRe: Edit control Pin
David Crow11-Jun-07 6:22
David Crow11-Jun-07 6:22 
AnswerRe: Edit control Pin
tom groezer11-Jun-07 8:29
tom groezer11-Jun-07 8:29 
GeneralRe: Edit control Pin
David Crow11-Jun-07 8:35
David Crow11-Jun-07 8:35 
GeneralRe: Edit control Pin
tom groezer11-Jun-07 21:04
tom groezer11-Jun-07 21:04 
QuestionRe: Edit control Pin
David Crow12-Jun-07 2:30
David Crow12-Jun-07 2:30 
QuestionFind Parent Dialog data in custom control on dialog? [modified] Pin
ldsdbomber11-Jun-07 4:00
ldsdbomber11-Jun-07 4:00 
I've used a customised list control that does alternate row shading but am also reading an article on how to get red text programmatically. As I'd like this too, I have added the necessary handling of NM_CUSTOMDRAW etc (well, I've found it in the shaded row source file),

what I want to do now is


if(some member variable in my single dialog)
then write this line in red

otherwise
write it in black

since I am in the function
void CColoredListCtrl::OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult)

what I want to know is how I can "get at" the parent dialog itself that has this listcontrol within it

something like


<getatthe cmaindialog="">.accessvariable

maybe

CWnd *GetParent(); is the first part, but then how do you get at the member variable (integer array that's within the parent dialog



I then thought of something like

CTestFolderBrowseDlg* myDlg = (CTestFolderBrowseDlg*)mainDlg;

and then using mainDlg as normal, but I can't include the header for my main dialog in this source file without it complaining, so I think I'm not doing this in the proper manner

for example if I put
#include "TestFolderBrowseDlg.h"

into ColoredListCtrl.cpp

it starts complaining about

testfolderbrowsedlg.h(33) : error C2065: 'IDD_TESTFOLDERBROWSE_DIALOG' : undeclared identifier
testfolderbrowsedlg.h(33) : error C2057: expected constant expression

which aren't present without the include to TestFolderBrowseDlg, but then the cast to myDlg from CWnd doesn't work





-- modified at 12:16 Monday 11th June, 2007
AnswerRe: Find Parent Dialog data in custom control on dialog? Pin
ldsdbomber11-Jun-07 6:21
ldsdbomber11-Jun-07 6:21 
GeneralRe: Find Parent Dialog data in custom control on dialog? Pin
Mark Salsbery11-Jun-07 6:54
Mark Salsbery11-Jun-07 6:54 
GeneralRe: Find Parent Dialog data in custom control on dialog? Pin
ldsdbomber11-Jun-07 21:27
ldsdbomber11-Jun-07 21:27 
GeneralRe: Find Parent Dialog data in custom control on dialog? Pin
Mark Salsbery12-Jun-07 6:31
Mark Salsbery12-Jun-07 6:31 
QuestionPassing parameters to Thread function. Pin
priyank_ldce11-Jun-07 3:33
priyank_ldce11-Jun-07 3:33 
AnswerRe: Passing parameters to Thread function. Pin
KarstenK11-Jun-07 3:47
mveKarstenK11-Jun-07 3:47 
AnswerRe: Passing parameters to Thread function. [modified] Pin
Mark Salsbery11-Jun-07 6:58
Mark Salsbery11-Jun-07 6:58 
AnswerRe: Passing parameters to Thread function. Pin
Mark Salsbery11-Jun-07 7:22
Mark Salsbery11-Jun-07 7:22 
AnswerRe: Passing parameters to Thread function. Pin
ThatsAlok11-Jun-07 20:03
ThatsAlok11-Jun-07 20:03 
QuestionQuick change of class of custom control? Pin
ldsdbomber11-Jun-07 3:26
ldsdbomber11-Jun-07 3:26 
AnswerRe: Quick change of class of custom control? Pin
ldsdbomber11-Jun-07 3:29
ldsdbomber11-Jun-07 3:29 
QuestionHow to detect modal loops in MFC Pin
Jörgen Sigvardsson11-Jun-07 3:21
Jörgen Sigvardsson11-Jun-07 3:21 
QuestionIOCP supports [modified] Pin
Jhony george11-Jun-07 3:05
Jhony george11-Jun-07 3:05 
AnswerRe: IOCP supports Pin
Matthew Faithfull11-Jun-07 3:28
Matthew Faithfull11-Jun-07 3:28 
GeneralRe: IOCP supports Pin
Jhony george11-Jun-07 19:40
Jhony george11-Jun-07 19:40 
QuestionConvert SYSTEMTIME to char * Pin
Programm3r11-Jun-07 2:45
Programm3r11-Jun-07 2:45 
AnswerRe: Convert SYSTEMTIME to char * Pin
Nibu babu thomas11-Jun-07 2:57
Nibu babu thomas11-Jun-07 2:57 

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.