|
Error 1 error C2039: CTabViewImpl ": not" WTL "the members of the
Error 2 error C2065: "CTabViewImpl": undeclared identifier
|
|
|
|
|
I've added aero looks to dialogs. Everything appears like working well, except CHyperLink. How it can be made "aero"?
Thank you!
|
|
|
|
|
I've tried to add aero::CMultiPaneStatusBarCtrl using analogy with aero::CStatusBarCtrl, but the VS compiler returned the error:
error C2385: ambiguous access of 'ProcessWindowMessage'
Here is the code:
///////////////////////////////////////////////////////////////////////////////
// aero::CMultiPaneStatusBarCtrl - Aero drawing MultiPaneStatusBar Control
typedef CCtrl<wtl::cmultipanestatusbarctrl> CMultiPaneStatusBarCtrl;
inline LPCWSTR CMultiPaneStatusBarCtrl::GetThemeName()
{
return L"STATUS";
};
inline void CMultiPaneStatusBarCtrl::CtrlPaint(HDC hdc, RECT& /*rCtrl*/, RECT& rPaint)
{
DefCtrlPaint(hdc, rPaint, true);
}
Would you help find proper way to define MultiPaneStatusBar? Thanks a lot for the article!
|
|
|
|
|
Hi Konstantin,
Konstantin Izmailov wrote: I've tried to add aero::CMultiPaneStatusBarCtrl using analogy with aero::CStatusBarCtrl, but the VS compiler returned the error:
error C2385: ambiguous access of 'ProcessWindowMessage'
WTL::CMultiPaneStatusBarCtrl is already deriving from ATL::CWindowImpl so you cannot use aero::CCtrl here. See the comment ahead of the class definition:
You have to derive from aero::CCtrlImpl and define your own DoPaint() member, for instance:
class CAeroMultiPaneStatusBarCtrl :
public aero::CCtrlImpl<CAeroMultiPaneStatusBarCtrl, CMultiPaneStatusBarCtrl>
{
public:
static LPCWSTR GetThemeName()
{
return L"STATUS";
};
void DoPaint(HDC hdc, RECT& rCtrl)
{
DefWindowProc(WM_ERASEBKGND, (WPARAM)hdc, 0);
DefWindowProc(WM_PAINT, (WPARAM)hdc, 0);
m_BufferedPaint.MakeOpaque(&rCtrl);
}
};
cheers,
AR
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)
|
|
|
|
|
Hi Alain,
thank you for the quick response! I've added the CAeroMultiPaneStatusBarCtrl class definition, but now the status bar is shown as a black stripe (only icons are visible). What is missing?
Konstantin
|
|
|
|
|
Hi Konstantin,
aero::CFrameWindowImpl overrides WTL::CFrameWindowImpl<>::CreateSimpleStatusBar() and subclasses the status bar to it's aero::CStatusBarCtrl m_ASB member.
You should declare a CAeroMultiPaneStatusBarCtrl in your frame class ...
CAeroMultiPaneStatusBarCtrl m_sb;
... and in your OnCreate() member call the original CreateSimpleStatusBar() and subclass it yourself:
WTL::CFrameWindowImpl<CMainFrame>::CreateSimpleStatusBar();
aero::Subclass(m_sb, m_hWndStatusBar);
cheers,
AR
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)
|
|
|
|
|
Wow, it works now (after adding WTL::CFrameWindowImpl<CMainFrame> in call to CreateSimpleStatusBar())! However, it looks like a normal status bar, but I expected it to be a semi-transparent, kinda "glass". Shouldn't it be semi-transparent?
Thank you very much for the help!
|
|
|
|
|
Thank you for the great article! However, I've got errors when tried to add things beyond the basic test app. For example, I've tried to add a pane with editbox on the left of the frame:
class CFilterView : public aero::CWindowImpl<CFilterView, CEdit>
{
...
BEGIN_MSG_MAP(CFilterView)
CHAIN_MSG_MAP(aero::CWindowImpl<CFilterView, CEdit>)
...
The line with CHAIN_MSG_MAP caused errors including "error C2352: 'CFilterView::ProcessWindowMessage' : illegal call of non-static member function".
What is the right way to chain events in this case? Many thx!
|
|
|
|
|
Hi Konstantin,
This compiles OK here:
class CFilterView : public aero::CWindowImpl<CFilterView, CEdit>
{
public:
typedef aero::CWindowImpl<CFilterView, CEdit> baseClass;
BEGIN_MSG_MAP(CFilterView)
CHAIN_MSG_MAP(baseClass)
END_MSG_MAP()
};
You will have to handle at least all messages in aero::CEdit message map for correct painting of your control.
cheers,
AR
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)
modified on Tuesday, August 24, 2010 5:40 AM
|
|
|
|
|
Hi Alain,
thank you! It compiles well now and I'm looking for example how to handle the messages. Would you recommend an article or example that can be used as analogy for the purpose of drawing CEdit?
I had also another thought - maybe it can be implemented as CEditView, i.e.
CCtrlImpl<CFilterView, WTL::CEditViewImpl<CFilterView> > ? In this case I will have to implement CEditView.
Konstantin
|
|
|
|
|
Hi Konstantin,
This can be a starting point:
class CFilterView : public aero::CWindowImpl<CFilterView, CEdit>
{
public:
typedef aero::CWindowImpl<CFilterView, CEdit> baseClass;
void Paint(CDCHandle dc, RECT& , RECT& , RECT& rDest)
{
DefWindowProc(WM_PAINT, (WPARAM)dc.m_hDC, 0);
if (m_BufferedPaint.m_hPaintBuffer)
m_BufferedPaint.MakeOpaque(&rDest);
}
BEGIN_MSG_MAP(CFilterView)
CHAIN_MSG_MAP(baseClass)
MESSAGE_HANDLER(EM_SETSEL, OnRedraw)
MESSAGE_HANDLER(WM_LBUTTONDOWN, OnRedraw)
MESSAGE_HANDLER(WM_MOUSEMOVE, OnRedraw)
MESSAGE_HANDLER(WM_KEYDOWN, OnRedraw)
MESSAGE_HANDLER(WM_PASTE, OnRedraw)
END_MSG_MAP()
LRESULT OnRedraw(UINT , WPARAM , LPARAM , BOOL& )
{
DefWindowProc();
Invalidate(FALSE);
return 0;
}
};
Konstantin Izmailov wrote: I had also another thought - maybe it can be implemented as CEditView
KISS
cheers,
AR
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)
|
|
|
|
|
|
im getting this error when i compiled your AeroDialog sample.
Error 2 error C2039: 'CTabViewImpl' : is not a member of 'WTL' aerosamples\aerosamples\wtlaero.h 1292 AeroDialog
Error 3 error C2065: 'CTabViewImpl' : undeclared identifier aerosamples\aerosamples\wtlaero.h 1292 AeroDialog
Error 4 error C2275: 'WTL::aero::CTabView' : illegal use of this type as an expression aerosamples\aerosamples\wtlaero.h 1292 AeroDialog
Error 5 error C2955: 'WTL::aero::CCtrlImpl' : use of class template requires template argument list aerosamples\aerosamples\wtlaero.h 1292 AeroDialog
Error 6 error C2143: syntax error : missing ',' before '>' aerosamples\aerosamples\wtlaero.h 1292 AeroDialog
Error 7 fatal error C1903: unable to recover from previous error(s); stopping compilation aerosamples\aerosamples\wtlaero.h 1295 AeroDialog
reagrds,
|
|
|
|
|
Hi,
In AeroDialog.cpp
#include <atlctrlx.h> before #include "WtlAero.h" .
Sorry of this missing line
cheers,
AR
|
|
|
|
|
You have to add below to "wtlaero.h":
#include <atlctrlx.h>
it works for me.
|
|
|
|
|
Error 1 error C2039: CTabViewImpl ": not" WTL "the members of the
|
|
|
|
|
my project is ocurred an error
=>syntax error : identification PICONINFOEX??
WHY??
|
|
|
|
|
If you can compile the article samples, you probably forgot to change the constants in stdafx.h as indicated in the article (see Guided tour Step 1[^]).
Otherwise your system is not correctly configured to compile for Vista targets. Give more details on your development platform and compiler.
cheers,
AR
|
|
|
|
|
Thank you for your kind answer~!
but I have a lot of problems as before..
I use Visulal Studio 2005 SP1 under Windows XP
and I installed Microsoft® Windows® Software Development Kit Update for Windows Vista™ because your link was failed.
and I installed WTL8.0 beta2
and I changed contents in stdafx.h
#define WINVER 0x0600
#define _WIN32_WINNT 0x0600
#define _WIN32_IE 0x0700
#define _RICHEDIT_VER 0x0200
but I can't compile in this step
help me
Thank you
|
|
|
|
|
Can you compile the samples in AeroSamples.zip?
AR
|
|
|
|
|
No I can't compile AeroSamples
this is the same error my test project
syntax error in atlctrls.h
PBUTTON_SPLITINFO
LPLVFOOTERINFO
PLVITEMINDEX
TVITEMPART
etc...
|
|
|
|
|
Include the Vista SDK headers instead of the original VS 2005 ones. Change the Tool->Options->Projects->VC++ include directories to get that.
cheers,
AR
|
|
|
|
|
it's easier to run the Integrate Windows SDK with Visual Studio 2005 shortcut which lives under the Microsoft SDK start menu entry
|
|
|
|
|
this program require the new sdk ,PICONINFOEX is defined in the vista sdk ,xp can not compile ,sorry for my poor English
|
|
|
|
|
Hi alain,
i have tried you example, but it failed because i can't create the Toolbar this way.
I think AtlCreateSimpleToolBar() is made for use with FrameWindows. So i decided to
use "my" toolbar, created from scratch
CToolBarCtrl tb;<br />
DWORD dwStyle = WS_CHILDWINDOW|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|TBSTYLE_TRANSPARENT|TBSTYLE_CUSTOMERASE|TBSTYLE_LIST|TBSTYLE_FLAT|CCS_NODIVIDER|CCS_TOP;<br />
DWORD dwExStyle = WS_EX_LEFT|WS_EX_LTRREADING|WS_EX_RIGHTSCROLLBAR|TBSTYLE_EX_DRAWDDARROWS|TBSTYLE_EX_DOUBLEBUFFER;<br />
tb.Create(m_hWnd, 0, 0, dwStyle, dwExStyle);<br />
tb.SetStyle(dwStyle);<br />
tb.SetExtendedStyle(dwExStyle);<br />
<br />
TBBUTTON tbButtons[] =<br />
{<br />
{0, 100, TBSTATE_ENABLED, BTNS_BUTTON|BTNS_AUTOSIZE|BTNS_SHOWTEXT|BTNS_DROPDOWN, 0, 0L, 0},<br />
{1, 101, TBSTATE_ENABLED, BTNS_BUTTON|BTNS_AUTOSIZE|BTNS_SHOWTEXT|BTNS_DROPDOWN, 0, 0L, 0},<br />
{2, 102, TBSTATE_ENABLED, BTNS_BUTTON|BTNS_AUTOSIZE|BTNS_SHOWTEXT|BTNS_DROPDOWN, 0, 0L, 0},<br />
{3, 103, TBSTATE_ENABLED, BTNS_BUTTON|BTNS_AUTOSIZE|BTNS_SHOWTEXT|BTNS_DROPDOWN, 0, 0L, 0},<br />
{4, 104, TBSTATE_ENABLED, BTNS_BUTTON|BTNS_AUTOSIZE|BTNS_SHOWTEXT|BTNS_DROPDOWN, 0, 0L, 0},<br />
{5, 105, TBSTATE_ENABLED, BTNS_BUTTON|BTNS_AUTOSIZE|BTNS_SHOWTEXT|BTNS_DROPDOWN, 0, 0L, 0},<br />
{6, 106, TBSTATE_ENABLED, BTNS_BUTTON|BTNS_AUTOSIZE|BTNS_SHOWTEXT|BTNS_DROPDOWN, 0, 0L, 0},<br />
};<br />
tb.SetButtonStructSize();<br />
int count = sizeof tbButtons / sizeof TBBUTTON;<br />
for (int i = 0; i < count; ++i)<br />
{<br />
ATL::CString text;<br />
if (i == 3)<br />
{<br />
text.Format(_T("Mein Lieblings-Button: %d"), i);<br />
}<br />
else<br />
{<br />
text.Format(_T("Button: %d"), i);<br />
}<br />
tbButtons[i].iString = tb.AddStrings(text);<br />
}<br />
tb.SetBitmapSize(0, 0);<br />
tb.AddButtons(count, tbButtons);<br />
tb.AutoSize();
But this way i got assertions in OnPaint, because CBufferedPaintImpl looks for an
ImageList and its Icons. After ignoring this assertions the toolbar lokes like a
thin white line. A little bit later the crash comes.
In my standard-application this toolbar works without problems. Any ideas from you ??
best regards
JJ
|
|
|
|
|