Click here to Skip to main content
15,913,055 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: error LNK2001 with static and global data in a Win32 C++ Dll Pin
Hashim Saleem24-Mar-04 11:02
Hashim Saleem24-Mar-04 11:02 
GeneralRe: error LNK2001 with static and global data in a Win32 C++ Dll Pin
BlackDice24-Mar-04 11:18
BlackDice24-Mar-04 11:18 
GeneralInvoking Outlook Exp. from VC++ Application. Pin
Pankaj Bhalla24-Mar-04 10:46
Pankaj Bhalla24-Mar-04 10:46 
Generallarge font vs. small font woes ... Pin
Maximilien24-Mar-04 10:15
Maximilien24-Mar-04 10:15 
GeneralRe: large font vs. small font woes ... Pin
Todd Smith25-Mar-04 13:28
Todd Smith25-Mar-04 13:28 
Questiondoc/view app with treeview on the left, how? Pin
lordgreg24-Mar-04 9:57
lordgreg24-Mar-04 9:57 
AnswerRe: doc/view app with treeview on the left, how? Pin
Prakash Nadar24-Mar-04 15:13
Prakash Nadar24-Mar-04 15:13 
GeneralRe: doc/view app with treeview on the left, how? Pin
axid3j1al24-Mar-04 19:24
axid3j1al24-Mar-04 19:24 
Option 1

Follow the excellent instructions from "Paul R Thompson"

Pauls Splitter Gear

Download and copy

MFC SplitterWnd Sample


Option 2

Copy this.


[1] Create new project (sdi)


Add this to MainFrm.h


CSplitterWnd split;
BOOL m_bInitSplit;


Initialise m_bInitSplit to FALSE in MainFrm.h constructor.



Override OnCreateClient in CMainFrame (alt+enter in VC 6.0 mode or ctrl-alt-x-click in BS .NET mode)

Add this

CRect cr;
GetClientRect( &cr);

if ( !split.CreateStatic( this,1,2) )
{
MessageBox( "Error setting up splitter frames!",
"Init Error!", MB_OK | MB_ICONERROR );
return FALSE;
}

/* Note CTreeStuff is not defined yet. See later */

if ( !split.CreateView( 0, 0,
RUNTIME_CLASS(CTreeStuff),
CSize(200,50), pContext ) )
{
MessageBox( "Error setting up splitter frames!",
"Init Error!", MB_OK | MB_ICONERROR );
return FALSE;
}

/* you will have to change this to your RUNTIME_CLAS CView derived class */
if ( !split.CreateView( 0, 1,
RUNTIME_CLASS(CtmpView),
CSize(cr.Width(),cr.Height()), pContext ) )
{
MessageBox( "Error setting up splitter frames!",
"Init Error!", MB_OK | MB_ICONERROR );
return FALSE;
}

m_bInitSplit = TRUE;

ensure that you replace

return CFrameWnd::OnCreateClient(lpcs, pContext);

with this

return TRUE;


Add a MFC class CTreeStuff deriving from CFormView

Drag a CTreeCtrl and plonk it your form view.

Add stuff to your tree control.

Regards,

axe
GeneralRe: doc/view app with treeview on the left, how? Pin
Prakash Nadar24-Mar-04 19:50
Prakash Nadar24-Mar-04 19:50 
GeneralRe: doc/view app with treeview on the left, how? Pin
axid3j1al24-Mar-04 20:11
axid3j1al24-Mar-04 20:11 
GeneralRe: doc/view app with treeview on the left, how? Pin
Prakash Nadar24-Mar-04 21:44
Prakash Nadar24-Mar-04 21:44 
AnswerRe: doc/view app with treeview on the left, how? Pin
axid3j1al25-Mar-04 10:59
axid3j1al25-Mar-04 10:59 
GeneralEMF editor / EMF SDK Pin
al_in_the_city24-Mar-04 9:09
al_in_the_city24-Mar-04 9:09 
GeneralRe: EMF editor / EMF SDK Pin
0v3rloader24-Mar-04 9:16
0v3rloader24-Mar-04 9:16 
GeneralRe: EMF editor / EMF SDK Pin
al_in_the_city24-Mar-04 9:29
al_in_the_city24-Mar-04 9:29 
GeneralRe: EMF editor / EMF SDK Pin
0v3rloader24-Mar-04 9:40
0v3rloader24-Mar-04 9:40 
GeneralRe: EMF editor / EMF SDK Pin
al_in_the_city24-Mar-04 9:49
al_in_the_city24-Mar-04 9:49 
GeneralSQLConnect --Invalid string or buffer length Pin
BlackDice24-Mar-04 9:06
BlackDice24-Mar-04 9:06 
GeneralRe: SQLConnect --Invalid string or buffer length Pin
0v3rloader24-Mar-04 9:18
0v3rloader24-Mar-04 9:18 
GeneralRe: SQLConnect --Invalid string or buffer length Pin
BlackDice24-Mar-04 9:32
BlackDice24-Mar-04 9:32 
GeneralRe: SQLConnect --Invalid string or buffer length Pin
0v3rloader24-Mar-04 9:43
0v3rloader24-Mar-04 9:43 
GeneralRe: SQLConnect --Invalid string or buffer length Pin
BlackDice24-Mar-04 9:49
BlackDice24-Mar-04 9:49 
GeneralRe: SQLConnect --Invalid string or buffer length Pin
0v3rloader24-Mar-04 10:00
0v3rloader24-Mar-04 10:00 
GeneralRe: SQLConnect --Invalid string or buffer length Pin
BlackDice24-Mar-04 10:09
BlackDice24-Mar-04 10:09 
GeneralMemory allocation failure Pin
AJarrett24-Mar-04 8:57
AJarrett24-Mar-04 8: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.