|
Might be caused by an stdafx.h include - if you're using precompiled headers, basically everything above #include "stdafx.h" is ignored silently.
add the warning(disable) to the stdafx.h, before you include any "offending" headers.
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
ammm, I'm not sure I know what stdafx.h is. My guess is it has to do with MFC, however there is no useage of MFC in the project.
Thanks.
|
|
|
|
|
stdafx.h has nothing to do with MFC, it's the standard header file used for precompiled header support in VC (most project wizards create one automatically, and set up the project accordingly).
Look in your Files tab if a stdafx.h is part of your project. If so, put the #pragma above the first #include.
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
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
|
|
|
|