|
Yes,you are right.Much nicer than use a CReBar.
Thank you very much.;);P
|
|
|
|
|
sorry,still a question.
Do I have to create a new class for the dialogBar If I want to change CTabCtrl into a CMyTabCtrl?
And from your way,how could I use the tabctrl directly from CMainFrame? If I create a new class for DialogBar,direct is impossible.
|
|
|
|
|
Although I don't see a good reason here to derive from CTabCtrl, let's say we do it.
Derive also from CDialogBar, first do some "cosmetics" like seen below, then add a CMyTabCtrl member.
#include "MyTabCtrl.h"
class CMyDialogBar : public CDialogBar
{
public:
CMyDialogBar();
enum { IDD = IDD_DIALOGBAR };
CMyTabCtrl m_tabCtrl;
protected:
virtual void DoDataExchange(CDataExchange* pDX);
protected:
LRESULT OnInitDialog(WPARAM wParam, LPARAM lParam);
DECLARE_MESSAGE_MAP()
};
CMyDialogBar::CMyDialogBar()
{
}
void CMyDialogBar::DoDataExchange(CDataExchange* pDX)
{
CDialogBar::DoDataExchange(pDX);
DDX_Control(pDX, IDC_TAB1, m_tabCtrl);
}
BEGIN_MESSAGE_MAP(CMyDialogBar, CDialogBar)
ON_MESSAGE(WM_INITDIALOG, OnInitDialog)
END_MESSAGE_MAP()
LRESULT CMyDialogBar::OnInitDialog(WPARAM wParam, LPARAM lParam)
{
if(! HandleInitDialog(wParam, lParam) || !UpdateData(FALSE))
{
TRACE0("Warning: UpdateData failed during dialog init.\n");
return LRESULT(0);
}
return LRESULT(1);
}
Then do not forget to chage the CDialogBar to CMyDialogBar in CMainFrame class, the rest remains like in my first example (handling TCN_SELCHANGE notification and so on).
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|
|
Perhaps your control is covered by another elements.
Try placing it on the top after creation:
m_wndTab.SetWindowPos( &CWnd::wndTop, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
|
|
|
|
|
If you need an additional toolbar, take a look at CMainFrame::OnCreate handler how the default toolbar is created. You will see how the bitmap image is assigned and how the control is docked.
|
|
|
|
|
I order to be docked, I suppose the control bar should implement some virtual functions like CalcDynamicLayout and CalcFixedLayout .
Instead of CTabCtrl , maybe you can use CToolBar , wich incorporates a CTabCtrl , accessible by GetToolBarCtrl() .
As a sample of resizable control bar, you can take a look at http://www.datamekanix.com[^].
|
|
|
|
|
I have a CRichEditCtrl , in a certain point i want to change the font, so what i will add to the rich edit using ReplaceSel will be in the new font i have selected...
I am using this code:
CHARFORMAT2 cf;
::ZeroMemory(&cf,sizeof(CHARFORMAT2));
cf.cbSize = sizeof(CHARFORMAT2);
int iTotalTextLength = GetWindowTextLength();
m_edtChatMsg.SetSel(iTotalTextLength, iTotalTextLength);
m_edtChatMsg.GetSelectionCharFormat(cf);
cf.dwMask = CFM_FACE | CFM_SIZE;
_tcscpy(cf.szFaceName,lpszFaceName);
cf.yHeight = nFontSize;
m_edtChatMsg.SetSelectionCharFormat(cf);
unfortunately this code isn't working
can any1 help?
thanks in advanced
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
Maybe instead of GetWindowTextLength() you should use m_edtChatMsg.GetTextLength() ?
|
|
|
|
|
no, it didn't help... although it was a small bug of mine
still, can't change the rich edit font
any other suggestions?
thanks
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
The next fragment sets the font and append a text:
long len = m_cRich.GetTextLength();
m_cRich.SetSel(len, len);
CHARFORMAT2 cf;
ZeroMemory(&cf, sizeof(cf));
cf.dwMask = CFM_FACE | CFM_SIZE;
lstrcpy(cf.szFaceName, _T("Courier New"));
cf.yHeight = 400;
m_cRich.SetSelectionCharFormat(cf);
m_cRich.ReplaceSel(_T("New text"));
It works.
-- modified at 6:16 Wednesday 21st June, 2006
|
|
|
|
|
thanks
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
See Here[^] maybe it is some helpful to you
whitesky
|
|
|
|
|
how we can get GMT time without using Current time
|
|
|
|
|
|
|
this is my code not workin
CTime time;
time.GetGmtTm(NULL);
m_time.Format("%d:%d:%d",time.GetHour(),time.GetMinute(),time.GetSecond());
|
|
|
|
|
sree_as wrote: this is my code not workin
What means 'not working' ? Compile error, runtime error, the code does not behave as expected (and supply information), or some other crazy thing...
Please, when asking a question, remember that we cannot see what you see !
Did you even try to read the links we gave you ?
This will do nothing:
time.GetGmtTm(NULL);
because you don't store the result. And you also constructed an uninitialised CTime object so it doesn't contain a valid date. Did you read the link I posted ? It describes how to construct a CTime with the current date and time.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
actually my problem is i have one dialog on that one combo box contains contry list and one static text for digital time.
it's is working.
but when we open my window time and u convert to another contry automatically our time changing.
due this currentTime().because when we changed it to another all will going wrong,
please help
sree.
|
|
|
|
|
You still didn't explain what the problem was. 'All will going wrong' won't help me very much to give you a detailed solution.
Where are you stuck ? What is the problem you are having ?
Did you read both links that we gave you ? They should contain enough information for you to know what to do. If not, is there something you didn't understand ?
And also, when explaining your problem, get rid of everything that is not related to the problem. Focus on the problem only.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
Cedric Moonen wrote: And also, when explaining your problem, get rid of everything that is not related to the problem. Focus on the problem only.
You are really very pedagogic today
Two times for different people in a few minutes.
Thank you! You are one of those keeping this site at the top
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
|
Hi,
I am using ShellExecute for the first time. But, I am encountering the following error:
error C2065: 'ShellExecute' : undeclared identifier
I have included windows.h and shellapi.h ... shell32.lib is also there. Can somebody suggest me a way out of this problem.
Thanks,
|
|
|
|
|
In an MFC based application you don't need to include any specific files for ShellExecute.
What type of application are you using?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
-- modified at 4:04 Wednesday 21st June, 2006
|
|
|
|
|
Perhaps you have included "shellapi.h" before "stdafx.h" . If so, move all of your #include directives after #include "stdafx.h" .
Hope it helps.
|
|
|
|
|
Thankyou! That was very helpful It worked.
--
Viorel. wrote: Perhaps you have included "shellapi.h" before "stdafx.h". If so, move all of your #include directives after #include "stdafx.h".
Hope it helps.
|
|
|
|