|
Are you being affected by:
For warning numbers greater than 4699, those associated with code generation, the warning pragma has effect only when placed outside function definitions. The pragma is ignored if it specifies a number greater than 4699 and is used inside a function.
If not, then MSDN article Q167355 is most likely the problem.
|
|
|
|
|
My mistake:
I put the pragma declaration after the include directives. Putting it before anything else made the trick.
Thanks for your help.
|
|
|
|
|
MSDN says you can have a CView or a CWnd as a pane in CSplitterWnd. CView is sorted but how do I create using a CWnd? There seems no equivalent to the CSplitterWnd::CreateView for CWnds.
cheers!!
Adam.
My world tour
What I do now..
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
|
|
Did you find the correct article? Just noticed I gave you the wriong link initially...
http://www.cherea.de/bitbucket/multisplitwnd/multisplitwnd.html
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Hi,
Is there a way to prevent dialog from closing when pressing on "enter" keyboard button?
Thanks
Everything's beautiful if you look at it long enough...
|
|
|
|
|
If you are using MFC, see this FAQ:
http://www.codeproject.com/cpp/cppforumfaq.asp#mfc_dlgclosekeys
|
|
|
|
|
|
You could always override CDialog::OnOK() but that would also stop the OK button from making your dialog disappear.
Adam.
My world tour
What I do now..
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
Also, don't forget to override OnCancel() if you don't want the dialog to disappear when the user presses Esc.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hmm..kinda wondering how to stop the enter button but still enable the Ok button (okay, I guess I could hide the default OK button, create a new one that does all the stuff but I think it is cheating....) any thoughts?
My world tour
What I do now..
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
I just delete the default (not hide) OK button and create a new one. Alternatively, you could override PreTranslateMsg() and catch the Enter keystroke there. I prefer the former way.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I was fiddling around with PreTranslateMessage to see if I could get it to work but I agree with you. The first way you mentioned is the way I have always done it and it still seems the simplest!
thanks!
Adam.
My world tour
What I do now..
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
one method is to rename the ID of button "OK",don't use IDOK.
another method is to define a function for press button "OK",in the function,
delete the line"CDialog::OnOk().
|
|
|
|
|
I've lost my mind and can't remember how to implement a cast operator. A gentle nudge would be appreciated.
I want to implement a (bool) operator for a CFoo object, so I can do things like:
CFoo myFoo;
bool myBool = myFoo;
CFoo myFoo;
if (myFoo) {
...
}
Thanks,
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
You failed to say if it was even safe to cast a CFoo object to a bool. Assuming it is, then bool myBool = (bool) myFoo; will work fine.
|
|
|
|
|
It will be safe once I create a cast operator.
I didn't want a caller example - I'm looking for a cast operator implementation sample (i.e. for the CFoo class). I've already implemented an assignment operator but am getting compilation errors when I try to take a stab at the cast operator.
Thanks,
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
My bad.
class CFoo
{
public:
operator bool() const
{
return m_someboolmember;
}
private:
bool m_someboolmember;
}
|
|
|
|
|
|
class CFoo
{
operator bool() { return IAmTrue; }
};
Be aware, however, that if yu have another cast operator to int, or T *, the if (myFoo) expression will be ambigous.
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Thanks, and yes that's a good point. As it happens, I've taken care to avoid this situation.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
|
|
Hi,
I have a dialog with a bitmap background. When I put my radio buttons on the dialog, I cannot see the bitmap under the rectangle created by the radio button. I would like to see the bitmap under the radio buttons?
I can change the color if I want with:
HBRUSH RightDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = ShapedDlg::OnCtlColor(pDC, pWnd, nCtlColor);
if ( pWnd->GetSafeHwnd() == GetDlgItem(IDC_RADIO1)->GetSafeHwnd() &&
CTLCOLOR_STATIC == nCtlColor )
{
// m_bkbrush is a CBrush member variable
m_bkbrush.CreateSolidBrush ( RGB(255,0,0) );
pDC->SetBkMode ( TRANSPARENT );
return m_bkbrush;
}
return hbr;
}
but what can I do if I have a bitmap unstead of solid color?
any ideas?
Regards
Mykel
Everything's beautiful if you look at it long enough...
|
|
|
|