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

C / C++ / MFC

 
GeneralMDI to SDI Pin
g.fadel9-Jun-03 20:44
g.fadel9-Jun-03 20:44 
GeneralRe: MDI to SDI Pin
Roger Allen10-Jun-03 0:26
Roger Allen10-Jun-03 0:26 
Generalkernel-mode code Pin
karanba9-Jun-03 20:32
karanba9-Jun-03 20:32 
GeneralRe: kernel-mode code Pin
peterchen9-Jun-03 21:47
peterchen9-Jun-03 21:47 
GeneralRe: kernel-mode code Pin
Peter Weyzen10-Jun-03 20:34
Peter Weyzen10-Jun-03 20:34 
GeneralStoring treeview control contents Pin
Dan Savilonis9-Jun-03 20:25
Dan Savilonis9-Jun-03 20:25 
GeneralRe: Storing treeview control contents Pin
peterchen9-Jun-03 21:45
peterchen9-Jun-03 21:45 
GeneralRe: Storing treeview control contents Pin
basementman10-Jun-03 4:14
basementman10-Jun-03 4:14 
You could always create a simple hierarchial recursive class to store the data... something like this (not complete):

class TreeNode : public CObject
{
protected:
CString m_cDisplayText;
int m_iIconIndex;
void *m_vpUserData;

CObList m_oChildNodes; // list of TreeNode elements

public:
TreeNode() { m_iIconIndex = 0; m_vpUserData = NULL}
TreeNode(LPCSTR cpDisplayText, int iIconIndex = 0, void *vpUserData = NULL)
{ m_cDisplayText = cpDisplayText;
m_iIconIndex = iIconIndex;
m_vpUserData = vpUserData;
}

~TreeNode()
{ TreeNode *pNode;
POSITION pPos = m_oChildNodes.GetHeadPosition();
while (pPos)
{
pNode = (TreeNode *)m_oChildNodes.GetNext(pPos);
if (pNode)
delete pNode;
}
}

// std accessors....
LPCSTR GetDisplayText()
{ return (LPCSTR)m_cDisplayText; }
void SetDisplayText(LPCSTR cpDisplayText)
{ m_cDisplayText = cpDisplayText; }

void *GetUserDataPtr() { return m_vpUserData; }
void SetUserDataPtr(void *vpUserData)
{ m_vpUserData = vpUserData; }

CObList *GetChildNodes() { return &m_oChildNodes; }

virtual void Serialize(CArchive &ar)
{
if (ar.IsStoring())
{
ar << m_cDisplayText << (DWORD)m_iIconIndex;
}
else
{
ar >> m_cDisplayText >> (DWORD&)m_iIconIndex;
}

m_oChildNodes.Serialize(ar);
}
};
GeneralIs there any class can be used as PictureBox Class Pin
jcpooh9-Jun-03 20:11
jcpooh9-Jun-03 20:11 
GeneralRe: Is there any class can be used as PictureBox Class Pin
Daniel Strigl9-Jun-03 22:03
Daniel Strigl9-Jun-03 22:03 
GeneralRe: Is there any class can be used as PictureBox Class Pin
jcpooh9-Jun-03 23:06
jcpooh9-Jun-03 23:06 
GeneralSynchronization - Wait Functions Pin
SNathani9-Jun-03 18:49
SNathani9-Jun-03 18:49 
GeneralRe: Synchronization - Wait Functions Pin
Branislav9-Jun-03 22:48
Branislav9-Jun-03 22:48 
GeneralRe: Synchronization - Wait Functions Pin
basementman10-Jun-03 4:17
basementman10-Jun-03 4:17 
GeneralRe: Synchronization - Wait Functions Pin
SNathani10-Jun-03 5:49
SNathani10-Jun-03 5:49 
GeneralSetFocus from OnInitDialog for Button control. Pin
anju9-Jun-03 18:38
anju9-Jun-03 18:38 
GeneralRe: SetFocus from OnInitDialog for Button control. Pin
SNathani9-Jun-03 18:56
SNathani9-Jun-03 18:56 
GeneralRe: SetFocus from OnInitDialog for Button control. Pin
anju9-Jun-03 20:21
anju9-Jun-03 20:21 
GeneralRe: SetFocus from OnInitDialog for Button control. Pin
Roger Allen10-Jun-03 0:30
Roger Allen10-Jun-03 0:30 
GeneralRe: SetFocus from OnInitDialog for Button control. Pin
anju10-Jun-03 2:04
anju10-Jun-03 2:04 
GeneralRe: SetFocus from OnInitDialog for Button control. Pin
basementman10-Jun-03 4:20
basementman10-Jun-03 4:20 
GeneralRe: Application Switch Pin
Anonymous9-Jun-03 17:46
Anonymous9-Jun-03 17:46 
GeneralRe: Application Switch Pin
Branislav9-Jun-03 23:12
Branislav9-Jun-03 23:12 
Generaluse wmi without wmi9x.exe on win9x Pin
semysemy819-Jun-03 16:49
semysemy819-Jun-03 16:49 
GeneralRe: use wmi without wmi9x.exe on win9x Pin
Michael Dunn9-Jun-03 19:54
sitebuilderMichael Dunn9-Jun-03 19:54 

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.