Click here to Skip to main content
15,887,135 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Using / accessing function pointer declaration externally Pin
CPallini8-Oct-16 3:16
mveCPallini8-Oct-16 3:16 
AnswerRe: Using / accessing function pointer declaration externally Pin
Richard MacCutchan7-Oct-16 2:32
mveRichard MacCutchan7-Oct-16 2:32 
QuestionHow to instantiate class with parameters - syntax please ? Pin
Vaclav_2-Oct-16 5:08
Vaclav_2-Oct-16 5:08 
AnswerRe: How to instantiate class with parameters - syntax please ? Pin
Richard MacCutchan2-Oct-16 6:05
mveRichard MacCutchan2-Oct-16 6:05 
AnswerRe: How to instantiate class with parameters - syntax please ? Pin
CPallini2-Oct-16 21:20
mveCPallini2-Oct-16 21:20 
QuestionRe: How to instantiate class with parameters - syntax please ? Pin
Krishnakumartg3-Oct-16 0:07
Krishnakumartg3-Oct-16 0:07 
AnswerRe: How to instantiate class with parameters - syntax please ? Pin
Vaclav_3-Oct-16 5:34
Vaclav_3-Oct-16 5:34 
GeneralRe: How to instantiate class with parameters - syntax please ? Pin
leon de boer3-Oct-16 16:25
leon de boer3-Oct-16 16:25 
You could be trying to do several things with the multiple inheritance you need to be very precise here.
You give us "parameterX" which is sort of labelled as text but that could mean a string class, a c string,
or a static const array. You also don't tell us whether the place you want to store the passed text is
in the object new to this class or part of one of the inherited classes, it may matter .. depends.

Do you see how many variations there are on what your simple description says? This is what makes multiple
inheritance tricky and you need to be very clear.

If you search the words "C++ composite class" is that what you are trying to do?

It appears to me you have jumped in at the deep end with C++ classes and trying to do the most complex
without first understanding the basics. I would highly recommend you might like to also do a search of
"C++ Parameterized Constructor" and review it given the code you have written above is nonsense.

I would also recommend you look at
Constructors (C++)[^]
That covers the basics of construction order and explicit and derived constructors in multiple inheritance.

My best guess you are trying to derive the base of a composite class and it would be this
class TestClass {
public:
	TestClass(const string& InitText) { text = InitText; };
	string text;
};

In vino veritas


modified 3-Oct-16 23:05pm.

GeneralRe: How to instantiate class with parameters - syntax please ? Pin
Krishnakumartg3-Oct-16 18:12
Krishnakumartg3-Oct-16 18:12 
GeneralRe: How to instantiate class with parameters - syntax please ? Pin
leon de boer3-Oct-16 22:49
leon de boer3-Oct-16 22:49 
AnswerRe: How to instantiate class with parameters - syntax please ? Pin
Vaclav_4-Oct-16 2:25
Vaclav_4-Oct-16 2:25 
GeneralRe: How to instantiate class with parameters - syntax please ? Pin
Richard MacCutchan4-Oct-16 3:46
mveRichard MacCutchan4-Oct-16 3:46 
GeneralRe: How to instantiate class with parameters - syntax please ? Pin
leon de boer4-Oct-16 7:16
leon de boer4-Oct-16 7:16 
GeneralRe: How to instantiate class with parameters - syntax please ? Pin
Vaclav_6-Oct-16 10:34
Vaclav_6-Oct-16 10:34 
GeneralRe: How to instantiate class with parameters - syntax please ? Pin
leon de boer6-Oct-16 19:04
leon de boer6-Oct-16 19:04 
QuestionWhy can't I assign a variable's address to an enum? Pin
arnold_w30-Sep-16 0:18
arnold_w30-Sep-16 0:18 
AnswerRe: Why can't I assign a variable's address to an enum? Pin
Richard MacCutchan30-Sep-16 0:52
mveRichard MacCutchan30-Sep-16 0:52 
AnswerRe: Why can't I assign a variable's address to an enum? Pin
leon de boer30-Sep-16 3:22
leon de boer30-Sep-16 3:22 
QuestionWaitForSingleObject best practices Pin
ForNow27-Sep-16 14:26
ForNow27-Sep-16 14:26 
AnswerRe: WaitForSingleObject best practices Pin
leon de boer27-Sep-16 18:18
leon de boer27-Sep-16 18:18 
GeneralRe: WaitForSingleObject best practices Pin
ForNow28-Sep-16 2:18
ForNow28-Sep-16 2:18 
GeneralRe: WaitForSingleObject best practices Pin
leon de boer28-Sep-16 8:16
leon de boer28-Sep-16 8:16 
GeneralRe: WaitForSingleObject best practices Pin
ForNow28-Sep-16 11:41
ForNow28-Sep-16 11:41 
GeneralRe: WaitForSingleObject best practices Pin
ForNow28-Sep-16 15:57
ForNow28-Sep-16 15:57 
GeneralRe: WaitForSingleObject best practices Pin
leon de boer28-Sep-16 19:20
leon de boer28-Sep-16 19:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.