Click here to Skip to main content
15,899,475 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: Should I learn ATL/COM now? Pin
Kevin McFarlane1-Aug-06 0:42
Kevin McFarlane1-Aug-06 0:42 
GeneralTo Zac Pin
CPP_Student31-Jul-06 12:36
CPP_Student31-Jul-06 12:36 
Questionvector -- call methods from inheritance classes [modified] Pin
RealWood30-Jul-06 4:56
RealWood30-Jul-06 4:56 
GeneralRe: vector -- call methods from inheritance classes Pin
Justin Tay30-Jul-06 5:46
Justin Tay30-Jul-06 5:46 
GeneralRe: vector -- call methods from inheritance classes Pin
RealWood30-Jul-06 8:09
RealWood30-Jul-06 8:09 
GeneralRe: vector -- call methods from inheritance classes [modified] Pin
Justin Tay30-Jul-06 10:37
Justin Tay30-Jul-06 10:37 
GeneralRe: vector -- call methods from inheritance classes [modified] Pin
Zac Howland31-Jul-06 9:03
Zac Howland31-Jul-06 9:03 
GeneralRe: vector -- call methods from inheritance classes Pin
RealWood31-Jul-06 11:32
RealWood31-Jul-06 11:32 
Thank you for your help,

@hfry:
My compiler (Visual Studio 2003) has problems with the following lines:

V.push_back(new Wrapper(new A));<br />
V.push_back(new Wrapper(new B));


The code output is "If you use a template class a template argument list is nessesary!" (translation from german).

After playing with the code I'm able to compile the wrapper class without pointer:

Wrapper<A> myWrapper(A); // with class 'A'

@Zac:
At this morning I produced a similar solution like you:

class Base : public QWidget<br />
{<br />
public:<br />
	// all of MyWidgets stuff<br />
	virtual void loadGUI() = 0;<br />
	virtual void reset() = 0;<br />
};<br />
<br />
class MyWidget : public Base<br />
{<br />
	// all of MyWidgets stuff<br />
	virtual void loadGUI() {/* does something*/}<br />
	virtual void reset() {/* does something else*/}<br />
};<br />
<br />
vector<Base*> V;<br />
<br />
V.push_back(new MyWidget);<br />
...


But your solution is better. First your base class doesn't care about QWidgets (= less/simple code). Second your advise to use stl-algorithms for a good health (I only want headaches with a lot of beer at the next party!).

Bye,

Thomas
QuestionHow to CComBSTR convert to char *? Pin
alan top29-Jul-06 2:49
alan top29-Jul-06 2:49 
AnswerRe: How to CComBSTR convert to char *? Pin
Monty229-Jul-06 21:36
Monty229-Jul-06 21:36 
GeneralRe: How to CComBSTR convert to char *? Pin
Jörgen Sigvardsson30-Jul-06 9:21
Jörgen Sigvardsson30-Jul-06 9:21 
AnswerRe: How to CComBSTR convert to char *? Pin
Michael Dunn29-Jul-06 23:24
sitebuilderMichael Dunn29-Jul-06 23:24 
AnswerRe: How to CComBSTR convert to char *? Pin
Zac Howland31-Jul-06 8:37
Zac Howland31-Jul-06 8:37 
GeneralRe: How to CComBSTR convert to char *? Pin
Jörgen Sigvardsson1-Aug-06 12:27
Jörgen Sigvardsson1-Aug-06 12:27 
QuestionScrolling Woes. Pin
HakunaMatada28-Jul-06 23:21
HakunaMatada28-Jul-06 23:21 
AnswerRe: Scrolling Woes. Pin
Monty229-Jul-06 21:38
Monty229-Jul-06 21:38 
GeneralRe: Scrolling Woes. Pin
HakunaMatada30-Jul-06 18:40
HakunaMatada30-Jul-06 18:40 
QuestionAbout IE 7 Tabs Pin
JaydeepB26-Jul-06 21:46
JaydeepB26-Jul-06 21:46 
AnswerRe: About IE 7 Tabs Pin
JaydeepB27-Jul-06 21:25
JaydeepB27-Jul-06 21:25 
GeneralRe: About IE 7 Tabs Pin
HunterNet19-Aug-06 5:16
HunterNet19-Aug-06 5:16 
QuestionCoCreateInstance() return E_OUTOFMEMORY Pin
chenxiujie26-Jul-06 19:43
chenxiujie26-Jul-06 19:43 
NewsRe: CoCreateInstance() return E_OUTOFMEMORY Pin
Anonymuos28-Jul-06 12:06
Anonymuos28-Jul-06 12:06 
QuestionHow to convert *string to _bstr_t and *BSTR Pin
agarunk26-Jul-06 4:38
agarunk26-Jul-06 4:38 
AnswerRe: How to convert *string to _bstr_t and *BSTR Pin
Lim Bio Liong27-Jul-06 8:00
Lim Bio Liong27-Jul-06 8:00 
GeneralRe: How to convert *string to _bstr_t and *BSTR Pin
agarunk27-Jul-06 19:43
agarunk27-Jul-06 19:43 

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.