|
I´m trying to build your project, but the Visual Studio .NT 2003 doesn´t get to find some atl, like atlddx.h and others that are not in Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include.
Where can I find these includes?
|
|
|
|
|
It sounds like you have not installed any of the WTL libraries. .NET default installation does not provide those libraries. See Petr Prikryl article for further explanations.
|
|
|
|
|
I was just ondering if it is possible to combine it together with MFC, e.g. instead of rich edit to include my own control from the MFC framework.
Thanks for help,
Pshem
|
|
|
|
|
Hi,
I liked it. It will help me to reimplement it on pure C++.
Cheers
|
|
|
|
|
Daniel Bowen updated his article on June 30th. His changes have caused this code to no longer compile. I want to use Igor's docking mixed with Daniel's tabs, so I would like to get this working again.
I have replaced:
this->m_idDlgCtrl = 0;
with:
this->SetDlgCtrlID(0);
This compiles and appears to work, but I have not spent enough time with WTL and this code to know if this is proper.
Thanks Igor & Daniel for your great efforts and sharing your results.
Erik.
|
|
|
|
|
Hello,
I tried to implement tab controls for dialogs in an application, but got some problems.The dialogs are objects derived from the following class:
class CMdiDlgView :
public CDialogImpl<cmdidlgview>,
public CDialogResize<cmdidlgview>,public CPaint1Bkgnd<cmdidlgview, lichtgeel="">
The code where I create the tabbed dialogs :
CMdiDlgView* m_AddView;
CModDlgView* m_ModifyView;
CTabbedPopupFrame<cdotnettabctrl<ctabviewtabitem> >* m_OutputFrame;
extern "C" BERDBDLL_API BOOL WINAPI CreateDBView(HWND m_hWndClient,RECT rcOutputFrame)
{
m_ModifyView.Create(m_OutputFrame);
m_AddView.Create(m_OutputFrame);
m_OutputFrame=new CTabbedPopupFrame<cdotnettabctrl<ctabviewtabitem> >;
m_AddView=new CMdiDlgView;
m_ModifyView=new CModDlgView;
m_OutputFrame->CreateEx(m_hWndClient, rcOutputFrame);
m_AddView->Create(m_OutputFrame->m_hWnd);
m_ModifyView->Create(m_OutputFrame->m_hWnd);
m_OutputFrame->AddTabWithIcon(m_AddView->m_hWnd, _T("Ajouter"), MAKEINTRESOURCE(IDR_DB_ADD));
m_OutputFrame->AddTabWithIcon(m_ModifyView->m_hWnd, _T("Modifier"), MAKEINTRESOURCE(IDR_DB_MODIFY));
return TRUE;
}
Now, when this is executed the m_ModifyView appears as expexted, but initially the tabs are not visible.I have to move the mouse out of the dialogwindow to get them visible. Furthermore, I have to click first the modifytab, then the addviewtab yo get the addview dialog.After this, I can work with the addview dialog.
Has someone a solution for this?
Kindly greetings,
Willy Lefebvre.
willy.lefebvre@ping.be
|
|
|
|
|
I finally found the solution by changing the method in TabbedFrame.h that adds the tabs :
int AddTabWithIcon(HWND hWnd, LPCTSTR sTabText, WTL::_U_STRINGorID icon, HMODULE hModule = _Module.GetResourceInstance())
{
if(hWnd == NULL)
{
return -1;
}
int nImageIndex = this->AddIcon(icon, hModule);
//*******************************************************
//MODSTART WL20062004 added to show tabs when created
// return this->AddTab(hWnd, sTabText, nImageIndex);
//is replaced by :
int ret;
ret= this->AddTab(hWnd, sTabText, nImageIndex);
this->DisplayTab(hWnd, TRUE, FALSE);
return ret;
//MODEND WL20062004
//**********************************************************
}
Now it works correctly.
Greetings,
Willy.
willy.lefebvre@ping.be
|
|
|
|
|
The source code defines three Client View states
stateNull = 0 // ClientView can be in Main Pane only
stateDockable = 1 // ClientView can be either in a dock pane or in a float frame
stateFloating = 2 // ClientView can be in a float frame only
However this is not respected by the drag implementation code. Main Pane Client Views can be dragged off to float frames.
A drag code fix is provided below. The fix will still allow Main Pane Client Views to be split within the Main Pane.
The fix is:
In file DockTabFrame.h in dropDrag function before line
if ( placeUNKNOWN == this->dragContext->targetPlace && placeFLOATFRAME == this->dragContext->sourcePlace) {
add the following code
if(this->getClientView(clientViewWnd)->getState()==ClientView::State::stateNull
&& this->dragContext->targetPlace!=placeMAINPANE){
this->dragContext->clearTrackRectangle();
delete this->dragContext;
this->dragContext = NULL;
return;
}
John Heenan
|
|
|
|
|
The memory leak I reported is fixed by the following code addition:
In file DockTabFrame.h at the end of function OnDropParcel replace
this->removeDropParcel( parcelTag);
with
if(dropParcel!=NULL){
delete dropParcel;
}
this->removeDropParcel( parcelTag);
John Heenan
|
|
|
|
|
Dragging windows from either a docked or main window state to a floating state and optionally back again results in accumulating memory leaks that are not cleaned up before final exit cleanup.
If no windows are dragged to a floating state then no memory leaks are reported.
Reproduction:
1. Add the following to the top of DockTabFrameWork.cpp (but below #include "stdafx.h")
#ifdef _DEBUG
#include <crtdbg.h>
#endif
2. Add the following to the top of _tWinMain
int tmp = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
tmp |= _CRTDBG_LEAK_CHECK_DF;
_CrtSetDbgFlag(tmp);
3. Use F5 to start a debug build in VS.NET debug environment
4. Drag any created window from a docked pane or main pane to a floating pane. The more drags and redocks the higher the number of memory leaks reported.
5. Exit application and observe reports in Output Window, such as:
The thread 'Win32 Thread' (0x376c) has exited with code 1 (0x1).
Detected memory leaks!
Dumping objects ->
{81} normal block at 0x00CC5618, 52 bytes long.
Data: < > 01 00 00 00 03 00 00 00 FF FF FF FF FF FF FF FF
Object dump complete.
The memory leak is probably bad luck. The code is solid, well written and easy to follow.
I am happy to give a score of 5.
John Heenan
|
|
|
|
|
Igor, this is just what I've been after for my project!
I've been umming and arring about doing something similar for a while now (MDI isn't really suited for my application) and now I don't have to codeit all myself!
kudos to you!
I'm gonna play around with this for a while and check out the code, but from the screenie it looks like it'll be great.
|
|
|
|
|
ok, so after playing with it for a bit, i realise i need to be able to at do the following things
1) save layouts
2) restore layouts
3) switch between layouts
4) auto hiding facilities - *I* can wait for this one, but maybe my users can't
i guess saving a layout is a case of iterating through the dockable areas, making a note of what is where and what it's split with (and so on..), a bit tricky though
ability to get a pane's object type from a pane specific LPARAM or something is required too.
For example - to describing a layout such as this one...
+--------------+----+
| | |
|=5============| |
+-----+--------+ |
| |=10:11==| |
| | | |
|=1===| | |
+-----+ | |
| | | |
| | | |
| +--------| |
|=2===|=12=====| |
+-----+ | |
| | |=6==|
| +--------+----+
| | |
|=3:4=|=7:8:9=======|
+-----+-------------+
we need to check each docking area, see what it contains and how it's docked to the areas above/below or left/right of it (depending on wether it's vertical or horizontal, respectively) and if it contains a group of frames, and what those frames are and which one is active.
we also need to be able to retreive (and later set) the floating x,y,w,h values for each frame.
I'm going to start with the left area, (panes 1 thu 4) in the figure above.
left area (areas 1 to 4), split horizontally into 2 panes, docked below top area, docked with bottom area, splitter position is 33%
--> pane 1, (area 1) contains one frame
----> frame 1, (area 1) object is: info panel
--> pane 2, (areas 2 and 3:4) split horizontally into 2 panes, splitter position is 50%
----> pane 1, (area 2) contains one frame
------> frame 1, (area 2) object is: server list
----> pane 2, (area 3 & 4) grouped pane container
------> group contains two frames, active frame is the second frame.
--------> frame 1, (area 3) object is: global user list
--------> frame 2, (area 4) object is: friends list
top area (area 5), contains 1 frame, docked with left window edge, docked with right area
--> frame 1 (area 5) object is: channel monitor
right area (area 6), contains 1 frame, docked with top window edge, docked with bottom area
--> frame 1 (area 6) object is: some other view
bottom area (area 7 to 9), contains group pane container, docked with left area, docked with right windowedge
--> grouped pane container, group contains two frames, active frame is the first frame.
----> frame 1 (area 7) object is: transfer panel
----> frame 1 (area 8) object is: event log panel
----> frame 1 (area 9) object is: output panel
and so on...
restoring a layout currently looks like it might not be possible as i don't see functions like dockTo(), groupWith() and splitWith().
to restore the above layout, we would add the views in the same order, calling dockTo(), groupWith(), and splitWith()
dockto() would take a frame and dock it with another frame so that it appears in the same split pane with tabs below it. dockto() also needs a parameter so that you can decide to leave make the frame active or leave the old frame you're docking with active.
groupwith() would take a frame and then dock another frame to it.
splitWith() would take a new frame object and split the area of the frame you're docking to in half (or preferably, a percentage of the area as a parameter) and show the new frame object in the other pane, you must also be able to specify that the new pane appears above/left or below/right of the existing frame.
thinking about it, we'd probably need three createframe() functions too, one to create one in a docked area (left, right, etc), one to create one split with another frame, and one to create one grouped with another frame()
Additonally, it would be nice to have the floating windows appear as app windows, i.e. they would appear on the taskbar.
i think that saving and restoring layouts should be left to the application that uses the layout tools and not done like sergey's docking windows are done. why? 1) sergey's saving/loading routines sometimes caused crashes, requiring the user to remove registry keys before the app could be run again, 2) different apps require different layout saving methods. my app really wants to save and restore layouts to/from XML files and not the registry.
with the above two functions it should be easy enough for any coder to simply remember where things are positioned and put them back in the same place.
Ok, comments?
|
|
|
|
|
Thank you for the feedback.
Good luck with your project.
Sincerely,
Igor.
|
|
|
|
|
I have installed Visual .NET studio. I have some experiences with VS6.0, but I'm somehow new to .NET. I have downloaded the project and tried just to build ewth... Errors occured because plenty of header files are missing...
What have I missed?
Line that produces error is:
#include <atlddx.h>
Error is:
g:\check.it.out\c\docktabframe_demo\docktabframe_demo\DockTabFrameWork\stdafx.h(20): fatal error C1083: Cannot open include file: 'atlddx.h': No such file or directory
And also others include directives produce errors, of course. Should this header file be one of .NET installed files?
Tnx
|
|
|
|
|
As I used a great work done by Bjarke Viksoe and Daniel Bowen my project requires some additional files.
Here I described what there are.
You should find all these files in include folder in demo project.
Check here for some information you might need.
Sincerely,
Igor.
|
|
|
|
|
As I wrote... Rookie I am
I discovered that I need to install Platform SDK and WTL7.1. I did. Now I can compile WTL examples that are included with WTL7.1 package.
(BTW which are the minimum PSDK components I need to install to properly support WTL - I have installed PSDK core components (web install) - but I find it very big. Is it neccessary whole?)
OK... New problems.
I have installed core PSDK components (February'03) and WTL7.1.
What have I mistaken now!
Thank you for bearing me
jOc
------ Build started: Project: SplitPaneDemo, Configuration: Debug Win32 ------
Compiling...
stdafx.cpp
c:\wtl71\include\atlctrls.h(551) : error C2039: 'CString' : is not a member of 'WTL'
c:\wtl71\include\atlctrls.h(694) : see reference to class template instantiation 'WTL::CListBoxT<tbase>' being compiled
c:\wtl71\include\atlctrls.h(874) : error C2039: 'CString' : is not a member of 'WTL'
c:\wtl71\include\atlctrls.h(1044) : see reference to class template instantiation 'WTL::CComboBoxT<tbase>' being compiled
c:\wtl71\include\atlctrls.h(2742) : error C2039: 'CString' : is not a member of 'WTL'
c:\wtl71\include\atlctrls.h(3606) : see reference to class template instantiation 'WTL::CListViewCtrlT<tbase>' being compiled
c:\wtl71\include\atlctrls.h(3752) : error C2039: 'CString' : is not a member of 'WTL'
c:\wtl71\include\atlctrls.h(4240) : see reference to class template instantiation 'WTL::CTreeViewCtrlT<tbase>' being compiled
c:\wtl71\include\atlctrls.h(4290) : error C2039: 'CString' : is not a member of 'WTL'
c:\wtl71\include\atlctrls.h(4347) : see reference to class template instantiation 'WTL::CTreeItemT<tbase>' being compiled
c:\wtl71\include\atlctrls.h(4619) : error C2039: 'CString' : is not a member of 'WTL'
c:\wtl71\include\atlctrls.h(5572) : error C2039: 'CString' : is not a member of 'WTL'
c:\wtl71\include\atlctrls.h(5686) : see reference to class template instantiation 'WTL::CStatusBarCtrlT<tbase>' being compiled
c:\wtl71\include\atlctrls.h(6789) : error C2039: 'CString' : is not a member of 'WTL'
c:\wtl71\include\atlctrls.h(7394) : see reference to class template instantiation 'WTL::CRichEditCtrlT<tbase>' being compiled
c:\wtl71\include\atlctrls.h(874) : error C2039: 'CString' : is not a member of 'WTL'
c:\wtl71\include\atlctrls.h(8045) : see reference to class template instantiation 'WTL::CComboBoxT<tbase>' being compiled
with
[
TBase=ATL::CWindow
]
c:\wtl71\include\atlctrls.h(8061) : see reference to class template instantiation 'WTL::CComboBoxExT<tbase>' being compiled
c:\wtl71\include\atlddx.h(314) : error C2039: 'CString' : is not a member of 'WTL'
c:\wtl71\include\atlddx.h(620) : see reference to class template instantiation 'WTL::CWinDataExchange<t>' being compiled
c:\wtl71\include\atlctrls.h(2742) : error C2039: 'CString' : is not a member of 'WTL'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlwin.h(2736) : see reference to class template instantiation 'WTL::CListViewCtrlT<tbase>' being compiled
with
[
TBase=ATL::CWindow
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlwin.h(2925) : see reference to class template instantiation 'ATL::CWindowImplRoot<tbase>' being compiled
with
[
TBase=WTL::CListViewCtrl
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlwin.h(3110) : see reference to class template instantiation 'ATL::CWindowImplBaseT<tbase,twintraits>' being compiled
with
[
TBase=WTL::CListViewCtrl,
TWinTraits=WTL::CCheckListViewCtrlTraits
]
c:\wtl71\include\atlctrlx.h(587) : see reference to class template instantiation 'ATL::CWindowImpl<t,tbase,twintraits>' being compiled
with
[
T=WTL::CCheckListViewCtrl,
TBase=WTL::CListViewCtrl,
TWinTraits=WTL::CCheckListViewCtrlTraits
]
c:\wtl71\include\atlctrlx.h(684) : see reference to class template instantiation 'WTL::CCheckListViewCtrlImpl<t>' being compiled
with
[
T=WTL::CCheckListViewCtrl
]
c:\wtl71\include\atlctrls.h(5572) : error C2039: 'CString' : is not a member of 'WTL'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlwin.h(2736) : see reference to class template instantiation 'WTL::CStatusBarCtrlT<tbase>' being compiled
with
[
TBase=ATL::CWindow
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlwin.h(2925) : see reference to class template instantiation 'ATL::CWindowImplRoot<tbase>' being compiled
with
[
TBase=WTL::CStatusBarCtrl
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlwin.h(3110) : see reference to class template instantiation 'ATL::CWindowImplBaseT<tbase,twintraits>' being compiled
with
[
TBase=WTL::CStatusBarCtrl,
TWinTraits=ATL::CControlWinTraits
]
c:\wtl71\include\atlctrlx.h(1806) : see reference to class template instantiation 'ATL::CWindowImpl<t,tbase>' being compiled
with
[
T=WTL::CMultiPaneStatusBarCtrl,
TBase=WTL::CStatusBarCtrl
]
c:\wtl71\include\atlctrlx.h(2128) : see reference to class template instantiation 'WTL::CMultiPaneStatusBarCtrlImpl<t>' being compiled
with
[
T=WTL::CMultiPaneStatusBarCtrl
]
Build log was saved at "file://g:\check.it.out\c\splitpane_demo\SplitPaneDemo\Debug\BuildLog.htm"
SplitPaneDemo - 12 error(s), 0 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped
|
|
|
|
|
What the VS.NET version do you use?
It should be compiled fine with VS.NET 2003 (7.1).
May be this is the difference?
I use WTL 7.0 with small fixes.
Also I think Platform SDK is not necessary.
Sincerely,
Igor.
|
|
|
|
|
I'm confused...
http://www.codeproject.com/wtl/wtl4mfc1.asp#readme
You need the Platform SDK. You can't use WTL without it. You can use the online SDK Update site, or download the CAB files and run the setup locally. Be sure you use the utility to add the SDK include and lib directories to the VC search path. You can find this in the Visual Studio Registration folder in the Platform SDK program group.
You need WTL. Download version 7 from Microsoft. See the articles "Introduction to WTL - Part 1" and "Easy installation of WTL" for some tips on installing the files. Those articles are rather out-of-date now, but still contain some good info. One thing which I don't think is mentioned in those articles is how to tell VC to search the WTL include directory. In VC 6, click Tools|Options and go to the Directories tab. In the Show directories for combo box, select Include files. Then add a new entry that points to the directory where you put the WTL header files.
I have VS.NET 2003 - that is 7.1
|
|
|
|
|
In stdafx.h file, move the <atlstr.h> to the first include, like this:
...
#include <atlstr.h>
#include <atlbase.h>
#include <atlapp.h>
#include <atlcoll.h>
extern CAppModule _Module;
#include <atlcom.h>
#include <atlhost.h>
#include <atlwin.h>
#include <atlctl.h>
#include <atlwin.h>
#include <atltypes.h>
#include <atlsplit.h>
#include <atlframe.h>
#include <atlctrls.h>
#include <atldlgs.h>
#include <atlddx.h>
#include <atlgdi.h>
#include <atlctrls.h>
#include <atlctrlx.h>
#include <atlctrlw.h>
|
|
|
|
|
#define _WTL_NO_CSTRING
#include <atlstr.h>
|
|
|
|
|
Problems, problems
If I use your latest version of the code, I get this kind of problems...
Still don't know where the problem is.
Thanks for any clue,
jOc
First error, which I repaired (sure hope I did) by changing the order of includes:
Compiling...
stdafx.cpp
c:\wtl71\include\atlddx.h(19) : fatal error C1189: #error : atlddx.h requires atlapp.h to be included first
Build log was saved at "file://g:\check.it.out\c\docktabframe_demo\DockTabFrameWork\Debug\BuildLog.htm"
DockTabFrameWork - 1 error(s), 0 warning(s)
Then this:
------ Build started: Project: DockTabFrameWork, Configuration: Debug Win32 ------
Compiling...
stdafx.cpp
Compiling...
DockTabFrameWork.cpp
g:\check.it.out\c\docktabframe_demo\include\CustomTabCtrl.h(255) : error C2872: 'CString' : ambiguous symbol
could be 'c:\wtl71\include\atlmisc.h(698) : WTL::CString'
or 'c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlstr.h(975) : ATL::CString'
g:\check.it.out\c\docktabframe_demo\include\CustomTabCtrl.h(256) : error C2872: 'CString' : ambiguous symbol
could be 'c:\wtl71\include\atlmisc.h(698) : WTL::CString'
or 'c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlstr.h(975) : ATL::CString'
|
|
|
|
|
You are absolutely right.
To compile with WTL 7.1 the order of include files in stdafx.h has to be like this:
<br />
#include <atlbase.h><br />
#include <atlcoll.h><br />
#include <atlstr.h><br />
#include <atltypes.h><br />
#include <atlwin.h><br />
<br />
#include <atlapp.h><br />
<br />
extern CAppModule _Module;<br />
<br />
#include <atlddx.h><br />
#include <atlsplit.h><br />
#include <atlctrls.h><br />
#include <atlctrlx.h><br />
#include <atlctrlw.h><br />
#include <atlframe.h><br />
#include <atldlgs.h><br />
The common rule is the first include files are atl files then wtl files. I hope it won't be the problem later.
You can download the correct demo here.
Sorry for the mess.
Sincerely,
Igor.
|
|
|
|
|
Ok!
It does compile with WTL7.0
I will later try to compile it without Platform SDK. It would be nice if it is not necessary, because it does take quite some space (about 500 megs, when only PSDK core components are installed) - I only have 80gigs disk, and I am slowly running out of space.
Tnx
|
|
|
|
|
Good!
So seems like there are problems with WTL 7.1.
I'll check it later.
Thank you for your efforts.
Sincerely,
Igor.
|
|
|
|
|
very Good ,I like it.
Erist.com
www.erist.com
|
|
|
|
|