C / C++ / MFC
|
|
 |

|
Philippe Mori wrote: See my answer above. You have misunderstood the standard.
Yes, you are correct.
|
|
|
|

|
It's just a matter of style, although I think the first option is preferred. MSDN has this to say[^] on the matter. You may also like to check if Bjarne Stroustrup has more to offer.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|

|
Thanks George
Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
|
|
|
|

|
...and don't forget that the compiler processes the initializer list following the declaration order given in the class definition.
So you better stick to that order in the list (to prevent confusion). There are tools availabe that check this (e.g. cppcheck)
|
|
|
|

|
// Is there any particular reason
Yes :
class A
{
public:
A();
A(int);
A& operator=(int);
};
class B
{
A m_a;
public:
B() { m_a = 3; }
};
They sought it with thimbles, they sought it with care;
They pursued it with forks and hope;
They threatened its life with a railway-share;
They charmed it with smiles and soap.
|
|
|
|

|
The difference is that, in the first way of initialization (known as 'Initialization List'), the constructors of the initialized members are called.
While in the second option, all the objects get constructed before reaching the first executable statement of the constructor. Hence in the second way of initialization, the assignment operators gets called.
|
|
|
|

|
Dear all,
HINSTANCE handle = ShellExecute(NULL, NULL, strHlpFile, NULL, NULL, SW_SHOW);
I create a application in MFC, it works fine in Window XP and return 42 value, but if run it in Window 7, it cannot open the .CHM or PDF file, the return code is 8.
What's the problem? how can I solve issue?
I try to use system() to launch .CHM or PDF file, it works fine in both Window XP and Window 7, but it has MS-DOS black screen there, how can I let MS-DOS not shown?
Thank you very much!
|
|
|
|

|
Andraw111 wrote: What's the problem? Something memory related.
Andraw111 wrote: how can I solve issue? What is the value of strHlpFile?
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|

|
Thanks for reply,
strHlpFile is the full path to .pdf file or .CHM file.
If it's about memory issue, how can I solve it?
|
|
|
|
 |
|
|
General
News
Suggestion
Question
Bug
Answer
Joke
Rant
Admin