|
Anu_Bala wrote: pSysBox->AddString((LPCTSTR)RGB(255,0,0));
The RGB[^] macro returns a COLORREF[^]. You're forcing the compiler away from complaining about this by cleverly casting the COLORREF value to an LPCTSTR .
If you want to add the string as it is, then try
pSysBox->AddString(_T("RGB(255,0,0)"));
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Anu_Bala wrote: CAlarmCombo *pSysBox = (CAlarmCombo *)((CMainFrame *)AfxGetMainWnd())->m_SysWnd.GetDlgItem(IDC_SYSALARM);
What a mess!
Anu_Bala wrote: pSysBox->AddString((LPCTSTR)RGB(255,0,0));
Do you know what an RGB value is? Hint: it can't be converted to a LPCTSTR by casting it.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
How can I create a virtual desktop, where I can show icons of desktop folder and also show a web page as active desktop.
Thanks,
Amit
|
|
|
|
|
What do you mean by a Virtual Desktop?
You can create another desktop using CreateDesktop[^].
|
|
|
|
|
Hi...
I am having the following code snap.
CString str = "this is a test program to broke cstring";
Now i need only upto "this is a te".
how to separate it?
G.Paulraj
|
|
|
|
|
CString str2 = str.Left(12);
Or
str.Delete(12, 0x7FFF);
|
|
|
|
|
|
In Visual C++ 6.0 I have two ActiveX control project. One ActiveX control is dependent on another ActiveX control. For that First Project is compiled succesfully and then in second project we used Project->Add To Project->Components and Controls-> then point to compiled first project ActiveX control.
Then It will insert .h and .cpp files to Second Project.
The same how to do in Visual Studio 2008. Please help regarding this
|
|
|
|
|
Hi,
Iam displaying child views as seperate window.When i maximize the view,it maximized up to top mainframe. But i want this: when i press the maximize button,the view should maximized up to the toolbar.Like the childwindow minimize,maximize button should appear below the toolbar.
How can i do this?Pls help me.
Anu
|
|
|
|
|
hi all...
iam a beginner in VC++
previously i have posted query regarding saving editbox contents and opening a text file...
it worked perfectly .. thanks for all support.. i have experienced a very fast response from this forum..
I have 4 editboxes.. i have added Cfontdialog to my application..
once i click ok it changes the font of the first editbox alone.. how can i change the font of other 3 editboxes indivitually... for that as per my understaning, i should find, in which editbox the cursor is... how can i achieve that...below code is for one edit box..
LOGFONT lf;
CFont *font = new CFont();
CFontDialog FontDlg(&lf);
if(FontDlg.DoModal() == IDOK)
{
font->CreateFontIndirect(&lf);
m_edit1.SetFont(font);
}
plz help me.. thanks in advance
|
|
|
|
|
|
hi..
thanks for the reply...
im facing a problem now..
the GetCaretPos() is always getting position of cursor in first edit box even if i keep the cursor in the second or third
Also GetCntrlID is returning me an integer value..
can u help me wid this...
|
|
|
|
|
heloo.. i solved the problem..
used CWnd *pwnd = CWnd::GetFocus();;
int wID = pwnd->GetDlgCtrlID();
thanks for the help
|
|
|
|
|
sonualex wrote: CFont *font = new CFont();
This variable should have class scope, and should not be a pointer.
sonualex wrote: once i click ok it changes the font of the first editbox alone.. how can i change the font of other 3 editboxes indivitually
Unless I'm just not understanding, what about:
if (FontDlg.DoModal() == IDOK)
{
font->CreateFontIndirect(&lf);
m_edit1.SetFont(&font);
m_edit2.SetFont(&font);
m_edit3.SetFont(&font);
m_edit4.SetFont(&font);
}
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
hi David..
nice to c u...
thanks for the reply....
below is my code... it worked fine
i used the font pointer here.. dint understand y v cant use pointer...
CWnd *pwnd = CWnd::GetFocus();;
int wID = pwnd->GetDlgCtrlID();
LOGFONT lf1;
CFont *font1 = new CFont();
switch(wID)
{
case IDC_EDIT1:
{
CFontDialog FontDlg1(&lf1);
if(FontDlg1.DoModal() == IDOK)
{
font1->CreateFontIndirect(&lf1);
m_edit1.SetFont(font1);
}
}
break;
}
|
|
|
|
|
sonualex wrote: i used the font pointer here.. dint understand y v cant use pointer...
Because it's completely unnecessary.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
ok.. thanks for that too..
|
|
|
|
|
Hello,
I have developped an ActiveX control using MFC which works flawlessly in any application, but randomly crashes when run in Internet Explorer. So I made a debug build of my control, and set iexplore.exe as the running process for debugging.
However, when I press F5, IE starts, and I can open the HTML file that has my activeX included, but I do not halt at any breakpoints. When I do the same with my testapp.exe, the same procedure works fine. What do you have to do in order to debug an ActiveX that is currently running in IE?
|
|
|
|
|
If you are using IE8, you can uninstall it and try with IE7.
|
|
|
|
|
Hi,
I am trying to automate the clicking of context menu items.
How do i click the items after the context menu is poped up on mouse right click.
Please any one there, your help is greatly needed
|
|
|
|
|
Use mouse_event API [^]
Величие не Бога может быть недооценена.
|
|
|
|
|
Thanks fo rur help.
I have one more question. How to find the position of the menu items?
|
|
|
|
|
Hello everyone !
I forget it,but I vaguely remember the function like this :
int MessageBoxTimer(<br />
HWND hWnd, <br />
LPCTSTR lpText, <br />
LPCTSTR lpCaption, <br />
UINT uType<br />
UINT uElapse, <br />
);
I don't want use FindWindow to close it,, thanks for you help !
Best Reguards!
|
|
|
|
|
|
Hi, I'm trying to make an application in MDI MFC with multiple view classes for a single doctemplate. I would like to be able to display the new CRecordView class by clicking on it's name from a menu. I really at a loss of how to do this, anyones input would be greatly appreciated and some code showing the method would be a life saver.
Thanks
|
|
|
|