|
Thank you, thank you very much for that link indeed.
Our Philosophy, Mohammed Baqir Al Sadr
|
|
|
|
|
Have a look at Boost Serialization[^] library. It does pretty much what you are trying to implement.
|
|
|
|
|
Thank you,too,Nemanja.
Our Philosophy, Mohammed Baqir Al Sadr
|
|
|
|
|
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style=WS_CHILD|WS_MAXIMIZE;
if( !CMDIChildWndEx::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style|=WS_CHILD|WS_MAXIMIZE;
if( !CMDIChildWndEx::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
|
|
|
|
|
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CMDIChildWndEx::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
why not like below?
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
return CMDIChildWndEx::PreCreateWindow(cs)
}
|
|
|
|
|
coded in the dark maybe ? ^^
seriously, I see no reasons at first sight...
|
|
|
|
|
The former may have been what was left after some code was removed. For example:
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CMDIChildWndEx::PreCreateWindow(cs) )
{
return FALSE;
}
return TRUE;
}
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
It looks like code the wizard would create, so you can insert your code before
the return TRUE;
If you're just going to call the base class, why override it?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
David Crow's mostly right, except you will likely add code before the TRUE (or before the PreCreateWindow.)
I was going to add that if you don't add code, the compiler will optimize the construct away. Out of curiosity, I tested this on VS 2005 and VC++ 6 and the result was a horror. For those curious, here's the resulting code with optimizations on:
mov eax, DWORD PTR _cs$[esp-4]
push eax
call ?PreCreateWindow@CView@@MAEHAAUtagCREATESTRUCTA@@@Z
neg eax
sbb eax, eax
neg eax
ret 4
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
NO difference.
-@SuDhIrKuMaR@-
|
|
|
|
|
Hi all,
Please tell me how can find the Feburary is Leap Year or not.
How can Check the number of days of Feburary,it is 28 or 29.
please help me for this.
I m waiting for your Valuable suggestions.
Thanks in Advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Well it is simple:
bool isLeapYear(int year )
{
return year % 400 ? year % 100 ? year % 4 ? false : true : false : true;
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
That's superb!
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Thank you, pal.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Jijo raj wrote: That's superb!
that's school classics...
I didn't bother posting it, as it's obvious you can find tons of functions doing this with google
|
|
|
|
|
Actually I extemporized.
(My school had nothing to do with C++ ).
BTW I think he was referring to handcrafted code obfuscation.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
WTF is going on here ?
since few days, everything I say is voted 1 !
BTW, whatever your school was doing (yeah, most school weren't teaching C/C++ in the 80's), but that's a classic anyway, and you find tons of it in google however !!!
|
|
|
|
|
Three 1 s, you have a lot of enemies! Got my five for a bit balancing.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
thanks for the "load balancing", but anyway, I still don't understand why those votes...
I believe so people find my answers arrogant too much, or are targetting my MVP status (I'm aware that I'm not the only MVP in that case), but whatever the reasons, I maintain that it was a question google had answered i less than 5 minutes...
|
|
|
|
|
toxcct wrote: I believe so people find my answers arrogant too much,
I guess the above is the reason. Anyway that doesn't justify them: I don't like down-voting-without-reply, i.e. if someone votes you down then (IMHO) he (or she) has the moral duty to make you know why.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Are you an adept of code obfuscation ?
|
|
|
|
|
Yes, a kind of: I was aware of it and I could not resist the temptation.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
|
No wonder: I'm a man.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
You can use COleDateTime::SetDate() . Check the return value to check whether the date is wrong. For instance, in your leap year checking case,
COleDateTime DateTime;
if( 0 == DateTime.SetDate( 2007, 2, 29 ))
{
}
if( 0 == DateTime.SetDate( 2008, 2, 29 ))
{
}
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|