Click here to Skip to main content
15,922,894 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CStdioFile::ReadString can't work Pin
David Fleming2-May-01 22:34
David Fleming2-May-01 22:34 
GeneralRe: CStdioFile::ReadString can't work Pin
hearties2-May-01 22:42
hearties2-May-01 22:42 
GeneralRe: CStdioFile::ReadString can't work Pin
David Fleming2-May-01 23:47
David Fleming2-May-01 23:47 
GeneralSending a Windows Message to signal socket activity Pin
2-May-01 20:16
suss2-May-01 20:16 
GeneralCheck boxes in CTreeCtrl Pin
Steve Driessens2-May-01 20:02
Steve Driessens2-May-01 20:02 
GeneralRe: Check boxes in CTreeCtrl Pin
Tomasz Sowinski2-May-01 23:15
Tomasz Sowinski2-May-01 23:15 
GeneralRe: Check boxes in CTreeCtrl Pin
Steve Driessens3-May-01 14:36
Steve Driessens3-May-01 14:36 
GeneralRe: Check boxes in CTreeCtrl Pin
Tomasz Sowinski3-May-01 23:42
Tomasz Sowinski3-May-01 23:42 
The solution is quite funny. Here's what I found in the "Tree View Control Window Styles" at MSDN:

"TVS_CHECKBOXES:
...
If you want to use this style, you must set the TVS_CHECKBOXES style with SetWindowLong after you create the treeview control, and before you populate the tree. Otherwise, the checkboxes might appear unchecked, depending on timing issues."

To solve the problem, you have to:
(1) clear the 'check boxes' option in the tree control properties in dialog editor
(2) programatically set the style after the window is created and before items are inserted:

m_Tree.ModifyStyle(0, TVS_CHECKBOXES);
for (...)
{
m_Tree.InsertItem(...);
m_Tree.SetCheck(...);
}


(2) is not enough (at least on my W2K box) - you can't have your tree control created with TVS_CHECKBOXES style.

Cheers,

Tomasz Sowinski
http://www.shooltz.com.pl
GeneralRe: Check boxes in CTreeCtrl Pin
Steve Driessens4-May-01 0:21
Steve Driessens4-May-01 0:21 
QuestionDo I HAVE to install MDAC for Office 2000? Pin
Matt Philmon2-May-01 12:02
Matt Philmon2-May-01 12:02 
GeneralProblem With Auto Complet. Pin
Ghasrfakhri2-May-01 9:32
Ghasrfakhri2-May-01 9:32 
GeneralRe: Problem With Auto Complet. Pin
Michael Dunn2-May-01 9:53
sitebuilderMichael Dunn2-May-01 9:53 
GeneralGetting hwnd of a child window Pin
Rukhsar2-May-01 8:03
Rukhsar2-May-01 8:03 
GeneralRe: Getting hwnd of a child window Pin
Stephen Caldwell2-May-01 14:36
Stephen Caldwell2-May-01 14:36 
GeneralKeeping process out of task manager Pin
Daníel B. Sigurgeirsson2-May-01 6:45
Daníel B. Sigurgeirsson2-May-01 6:45 
GeneralRe: Keeping process out of task manager Pin
Tomasz Sowinski2-May-01 23:19
Tomasz Sowinski2-May-01 23:19 
GeneralRe: Keeping process out of task manager Pin
yamini3-May-01 0:30
yamini3-May-01 0:30 
GeneralRe: Keeping process out of task manager Pin
Daníel B. Sigurgeirsson4-May-01 3:39
Daníel B. Sigurgeirsson4-May-01 3:39 
GeneralRe: Keeping process out of task manager Pin
Tomasz Sowinski4-May-01 3:55
Tomasz Sowinski4-May-01 3:55 
GeneralRe: Keeping process out of task manager Pin
Tomasz Sowinski4-May-01 4:07
Tomasz Sowinski4-May-01 4:07 
GeneralRe: Keeping process out of task manager Pin
Daníel B. Sigurgeirsson4-May-01 4:50
Daníel B. Sigurgeirsson4-May-01 4:50 
GeneralRe: Keeping process out of task manager Pin
Tomasz Sowinski4-May-01 10:06
Tomasz Sowinski4-May-01 10:06 
GeneralRe: Keeping process out of task manager Pin
Daníel B. Sigurgeirsson7-May-01 2:48
Daníel B. Sigurgeirsson7-May-01 2:48 
GeneralTrying to make a program bulletproof Pin
Daníel B. Sigurgeirsson2-May-01 6:39
Daníel B. Sigurgeirsson2-May-01 6:39 
GeneralChild Windows Pin
2-May-01 6:08
suss2-May-01 6:08 

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.