 common problem for people who are fresh at C++. What you need to do is include guards in every header file that prevent multiple inclusion.
I always put the following in
#ifndef __filename_goes_here_H
#define __filename_goes_here_H
// Contents of header file followed by
#endif
So if your CDeta class was defined in a file deta.h then you should use...
#ifndef __DETA_H
#define __DETA_H
class CDeta
{
};
#endif
The #ifndef .. #define should be the first thing in your file. The #endif should be the last.
You also need to make sure that the __DETA_H bit is different in every header file (that's why I always use an uppercase version of the filename).
That should do the trick.
but when i run my s/w which makes use of "Microsoft Chart Control ver. 6.0"
(which creates "mschart.h" file )
I am getting error dialog box ,as
Debug assertion failed
File : winocc.cpp
Line :345
for information on how your program can cause an assertion failure see VC++ documentation on assert .
Abort Retry ignore
when i clicks "Retry" it comes to the window " this program has performed an illigal operation & closed down"
and it closes the whole project.
will you please tell me why this happens
the changes i made in mschart.h
are
#ifndef __CMSChart_H
#define __CMSChart_H
......
file statments ...
......
#endif
What you need to do is...
A. Give me the points for getting the first question right!!! (Am I mercenary or what!)
B. Raise a new question regarding your assertion failure. I'm afraid I've never used MSChart and as this question is now so old I don't think anybody else will be reading it.
Actually, a general word about assertions that are raised in Microsoft's code... When the debugger allows you to debug the code you should always have a look at it, you never know the Microsoft chaps may have put a comment near the ASSERTion that give you an indication of why it has happened.
Cheers, Carl.
P.S. Make sure that your MSChart control is properly created and initialised before trying to do anything with it.
cheers ,
thanks for your answer .
I don't suppose there's much chance of getting a birthday card of you either!!!