 |
|
 |
Error 2 error C2955: 'FreshUI::TitlebarSubstitute' : use of class template requires template argument list c:\down\linnkoiut\wtl\titlebar_demo\titlebardemo\titlebar.h 30
Error 4 error C2955: 'FreshUI::TitlebarSubstitute' : use of class template requires template argument list c:\down\linnkoiut\wtl\titlebar_demo\titlebardemo\titlebar.h 30
Error 6 error C2955: 'FreshUI::TitlebarSubstitute' : use of class template requires template argument list c:\down\linnkoiut\wtl\titlebar_demo\titlebardemo\titlebar.h 30
Error 1 error C3203: 'TitlebarSubstitute' : unspecialized class template can't be used as a template argument for template parameter 'T', expected a real type c:\down\linnkoiut\wtl\titlebar_demo\titlebardemo\titlebar.h 30
Error 3 error C3203: 'TitlebarSubstitute' : unspecialized class template can't be used as a template argument for template parameter 'T', expected a real type c:\down\linnkoiut\wtl\titlebar_demo\titlebardemo\titlebar.h 30
Error 5 error C3203: 'TitlebarSubstitute' : unspecialized class template can't be used as a template argument for template parameter 'T', expected a real type c:\down\linnkoiut\wtl\titlebar_demo\titlebardemo\titlebar.h 30
|
|
|
|
 |
|
 |
just check the post: "Visual Studio 2005 Compatibility Fix"
|
|
|
|
 |
|
 |
This is a nice work. I also keen to know that how can I achieve the same in BV.NET or C#.NET labguage.
Fazal Khan
|
|
|
|
 |
|
 |
If I double click on the titlebar when the maximize button is disabled the whole application is moved to a different location on screen (or even outside the screen).
What could cause this and how can it be fixed?
Tried this with a dialog based application.
|
|
|
|
 |
|
 |
Templates have been changed slightly in Visual Studio 2005 which inhibits this code from compiling. To make it 2005 compatible you need to change line 30 of titlebar.h.
Old code:
class TitlebarSubstitute : public CWindowImpl <TitlebarSubstitute>>
New code:
class TitlebarSubstitute : public CWindowImpl <TitlebarSubstitute<TButton>>
This is necessary because Visual Studio 2005 requires all templated base classes to be fully defined.
Side note:
To run this demo in 2005, you will also need to remove one of the multiple manifest declarations that the VS 2005 wizard generates. I think the easiest way to do this is to comment out the 'CREATEPROCESS_MANIFEST_RESOURCE_ID' value from the resource file. (More specifically in regaurd to this project - comment out line 358 of TitlebarDemo.rc once VS converts the project)
Hyteq Systems
Carlo McWhirter
|
|
|
|
 |
|
 |
This is a really nice article. I would like to customize the title bar but for MFC applications. Do you have any ideea where I could find something like this but for MFC?
regards,
Mircea
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
 |
|
 |
I think we have the same problem. I'm just wondering if you were able to get something for MFC. Thanks in advance.
|
|
|
|
 |
|
 |
It's been a long time since I worked with MFC, but what I did at the time was to simulate the title bar using a background image. I simply hidden the title bar from the form and at the top of the form added a picture of the title bar I needed. Then added image buttons for minimize, maximize, close over that image.
I used a couple of controls found here on CP. Can't remember exactly which, but it was one that set a picture as background for a form and one image button control. If you search in the articles you will find them.
I wish I could be more helpful but I don't have the source code to see exactly which controls were because I am no longer working at the company I used to when I developed them.
regards,
Mircea
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
 |
|
 |
I can't compile it under VC7&WTL7..It seems very strange, because:
e:\Project\BBClient\include\Titlebar.h(608) : error C2065: 'TITLEBARINFO' : undeclared identifier
e:\Project\BBClient\include\Titlebar.h(600) : while compiling class-template member function 'void FreshUI::Titlebar::Init(void)'
with
[
T=CExitDlg,
TSubstitute=FreshUI::WrittenInMidnight
]
e:\Project\BBClient\ExitDlg.h(10) : see reference to class template instantiation 'FreshUI::Titlebar' being compiled
with
[
T=CExitDlg,
TSubstitute=FreshUI::WrittenInMidnight
]
e:\Project\BBClient\include\Titlebar.h(608) : error C2146: syntax error : missing ';' before identifier 'tbi'
e:\Project\BBClient\include\Titlebar.h(608) : error C2065: 'tbi' : undeclared identifier
e:\Project\BBClient\include\Titlebar.h(609) : error C2228: left of '.cbSize' must have class/struct/union type
type is ''unknown-type''
e:\Project\BBClient\include\Titlebar.h(609) : error C2070: ''unknown-type'': illegal sizeof operand
e:\Project\BBClient\include\Titlebar.h(609) : error C3861: 'tbi': identifier not found, even with argument-dependent lookup
e:\Project\BBClient\include\Titlebar.h(609) : error C3861: 'TITLEBARINFO': identifier not found, even with argument-dependent lookup
e:\Project\BBClient\include\Titlebar.h(610) : error C3861: 'GetTitleBarInfo': identifier not found, even with argument-dependent lookup
e:\Project\BBClient\include\Titlebar.h(610) : error C3861: 'tbi': identifier not found, even with argument-dependent lookup
e:\Project\BBClient\include\Titlebar.h(611) : error C2228: left of '.rcTitleBar' must have class/struct/union type
type is ''unknown-type''
e:\Project\BBClient\include\Titlebar.h(611) : error C3861: 'tbi': identifier not found, even with argument-dependent lookup
It makes me very disappointed.. these definitions are found in winuser.h!!!In fact, the STRICT macro is also defined!!
|
|
|
|
 |
|
 |
Hi,
I'm programming in VS .NET 2003 in c++ and I was running into that same problem. To fix it I needed to change the compatible windows version from 0x0400 to 0x0500. I don't if this will help, I have no experience with VB.
In MFC in stdafx.h
// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef WINVER // Allow use of features specific to Windows 95 and Windows NT 4 or later.
#define WINVER 0x0500 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
#endif
#ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later.
#define _WIN32_WINNT 0x0500 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
#endif
#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0510 // Change this to the appropriate value to target Windows Me or later.
#endif
#ifndef _WIN32_IE // Allow use of features specific to IE 4.0 or later.
#define _WIN32_IE 0x0500 // Change this to the appropriate value to target IE 5.0 or later.
|
|
|
|
 |
|
 |
Is there any way one can change the icon and the text alone in the main frame title bar?
Tara
|
|
|
|
 |
|
 |
The title bar does not hide when I hide the window. Of course I'm sure this is my problem but can you suggest what kinds of mistakes (such as not passing on some particular message) might be causing this? Thanks.
|
|
|
|
 |
|
 |
If you are tyring to hide the title bar by means of ShowWindow(SW_HIDE), please note that the title bar itself is another window with its own window handle and everything else.
So, you should call ShowWindow(SW_HIDE) on both windows.
|
|
|
|
 |
|
|
 |
|
 |
White durt dot on titlebar? why?
|
|
|
|
 |
|
 |
Thank you for your interest. But I cannot get the exact meaning of your message. Could you please mail me with more detail explaination?
Thanks again.
Junlei Li
|
|
|
|
 |
|
 |
There is a little dot on the title bar!
|
|
|
|
 |
|
 |
Thank you for your chariness. Since I cannot predicate the size of a system button, I create a figure region in LinuxSystemButton:: DrawButtonFigure and center it in the button rect. For “minimize” button, a special condition occurs. The figure of minimize system button is always not at the center. So I have to add a “dirt point” to the figure region, and then there’s the look you pointed out. See the following piece of code:
void DrawButtonFigure(HDC hDC, COLORREF cr = RGB(0, 0, 0))
{
RECT rcClient;
::GetClientRect(m_hWnd, &rcClient);
HBRUSH hbr = CreateSolidBrush(cr);
// Picture
HRGN hRgnFigure = NULL;
switch(m_uID)
{
case SYSTEM_BUTTON_SYSTEMMENU:
//
break;
case SystemButton::SYSTEM_BUTTON_CLOSE:
//
break;
case SystemButton::SYSTEM_BUTTON_MAXIMIZE_RESTORE:
{
//
}
break;
case SystemButton::SYSTEM_BUTTON_MINIMIZE:
{
hRgnFigure = CreateRectRgnIndirect(&m_rcMinimize);
RECT rcTemp = {
m_rcMinimize.left,
m_rcMinimize.bottom - m_rcMinimize.right + m_rcMinimize.left,
m_rcMinimize.right,
m_rcMinimize.bottom
};
HRGN hRgnTemp = CreateRectRgn(rcTemp.left, rcTemp.top, rcTemp.left + 1, rcTemp.top + 1);
CombineRgn(hRgnFigure, hRgnFigure, hRgnTemp, RGN_OR);
DeleteObject(hRgnTemp);
}
break;
case SystemButton::SYSTEM_BUTTON_HELP:
{
//
}
break;
default:
break;
}
// Center hRgnFigure
RECT rcBound;
GetRgnBox(hRgnFigure, &rcBound);
OffsetRgn(hRgnFigure,
(rcClient.right - rcClient.left - rcBound.right + rcBound.left) / 2,
(rcClient.bottom - rcClient.top - rcBound.bottom - rcBound.top) / 2);
FillRgn(hDC, hRgnFigure, hbr);
if(hRgnFigure != NULL)
DeleteObject(hRgnFigure);
DeleteObject(hbr);
}
The most important reason I posted this article is to provide a new way to deal with window title bar’s customization. But because of the reason of lack of time, there’re several bugs like this remain in the source code. Some kind readers like you have reminded me of the bugs. I really appreciate your help. Weeks later I will remove the bugs and update the article
Thank you again!
Junlei Li
|
|
|
|
 |
|
 |
Conf:
Win XP Prof Sp1
MS VS 6.0 Sp5
WTL 7.0
Wont compile:
IPrintDialogCallback and 8 more things are undefined..
When i change
#define WIN_VER
from 0500 to 0400 it says that several things related to title bars are undefined.
Ideas?
Sincerely yours, Ilya Kalujny.
|
|
|
|
 |
|
 |
Try changing WIN_VER to 0x0501, which is Windows XP and 2003 specific.
|
|
|
|
 |
|
 |
Anonymous wrote:
Try changing WIN_VER to 0x0501, which is Windows XP and 2003 specific.
Negative
Somthng wrong with the atldlgs.h header?
=== Cut
d:\program files\microsoft visual studio\wtl70\include\atldlgs.h(1224) : error C2504: 'IPrintDialogCallback' : base class undefined
d:\program files\microsoft visual studio\wtl70\include\atldlgs.h(1423) : see reference to class template instantiation 'WTL::CPrintDialogExImpl' being compiled
d:\program files\microsoft visual studio\wtl70\include\atldlgs.h(1228) : error C2146: syntax error : missing ';' before identifier 'm_pdex'
d:\program files\microsoft visual studio\wtl70\include\atldlgs.h(1423) : see reference to class template instantiation 'WTL::CPrintDialogExImpl' being compiled
d:\program files\microsoft visual studio\wtl70\include\atldlgs.h(1228) : error C2501: 'PRINTDLGEX' : missing storage-class or type specifiers
d:\program files\microsoft visual studio\wtl70\include\atldlgs.h(1423) : see reference to class template instantiation 'WTL::CPrintDialogExImpl' being compiled
d:\program files\microsoft visual studio\wtl70\include\atldlgs.h(1228) : error C2501: 'm_pdex' : missing storage-class or type specifiers
d:\program files\microsoft visual studio\wtl70\include\atldlgs.h(1423) : see reference to class template instantiation 'WTL::CPrintDialogExImpl' being compiled
d:\program files\microsoft visual studio\wtl70\include\atldlgs.h(1224) : error C2504: 'IPrintDialogCallback' : base class undefined
d:\program files\microsoft visual studio\wtl70\include\atldlgs.h(1426) : see reference to class template instantiation 'WTL::CPrintDialogExImpl' being compiled
d:\program files\microsoft visual studio\wtl70\include\atldlgs.h(1228) : error C2146: syntax error : missing ';' before identifier 'm_pdex'
d:\program files\microsoft visual studio\wtl70\include\atldlgs.h(1426) : see reference to class template instantiation 'WTL::CPrintDialogExImpl' being compiled
d:\program files\microsoft visual studio\wtl70\include\atldlgs.h(1228) : error C2501: 'PRINTDLGEX' : missing storage-class or type specifiers
d:\program files\microsoft visual studio\wtl70\include\atldlgs.h(1426) : see reference to class template instantiation 'WTL::CPrintDialogExImpl' being compiled
d:\program files\microsoft visual studio\wtl70\include\atldlgs.h(1228) : error C2501: 'm_pdex' : missing storage-class or type specifiers
d:\program files\microsoft visual studio\wtl70\include\atldlgs.h(1426) : see reference to class template instantiation 'WTL::CPrintDialogExImpl' being compiled
e:\ilya\distrib\titlebardemo\titlebardemo\stdafx.cpp(8) : error C2856: #pragma hdrstop cannot be inside an #if block
Error executing cl.exe.
=== Cut
Sincerely yours, Ilya Kalujny.
|
|
|
|
 |
|
 |
The previous message is not posted by me. I haven't a XP OS. And I'm so appreciated the help of "Anonymous", since I know nothing about XP.
I think the reason is that you have not installed Platform SDK. Interface 'IPrintDialogCallback' is provided by Platform SDK, and is not included in VS6.
If I'm wrong please contact me by mail. By the way, I will update this article with more detail explanation and customized title bar looking soon.
Thank you for your interest!
Junlei Li.
|
|
|
|
 |
|
 |
I have had the same problem as you do, but tried to fix it by reinstall platform-SDK!
Install a platform-SDK with properly version and then restart your PC. I think that will work!
|
|
|
|
 |
|
 |
Where is atlres.h wich is included in titlebardemo.rc file
vijay_visana
|
|
|
|
 |
|
 |
You need to download the WTL from Microsoft. Look in this section (WTL) of CodeProject for details.
|
|
|
|
 |