Click here to Skip to main content
15,905,419 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: 0x80040111 ClassFactory cannot supply requested class Pin
ggoutam727-Jul-10 0:09
ggoutam727-Jul-10 0:09 
GeneralRe: 0x80040111 ClassFactory cannot supply requested class Pin
Randor 27-Jul-10 9:36
professional Randor 27-Jul-10 9:36 
GeneralRe: 0x80040111 ClassFactory cannot supply requested class Pin
ggoutam727-Jul-10 16:07
ggoutam727-Jul-10 16:07 
Questionhow to read MSDN documentation?? Pin
AmbiguousName26-Jul-10 10:05
AmbiguousName26-Jul-10 10:05 
AnswerRe: how to read MSDN documentation?? Pin
Maximilien26-Jul-10 10:11
Maximilien26-Jul-10 10:11 
GeneralRe: how to read MSDN documentation?? Pin
Tomz_KV27-Jul-10 2:36
Tomz_KV27-Jul-10 2:36 
GeneralRe: how to read MSDN documentation?? Pin
ely_bob27-Jul-10 4:31
professionalely_bob27-Jul-10 4:31 
GeneralRe: how to read MSDN documentation?? Pin
Tomz_KV27-Jul-10 4:42
Tomz_KV27-Jul-10 4:42 
GeneralRe: how to read MSDN documentation?? Pin
Thomas Vanderhoof27-Jul-10 2:44
professionalThomas Vanderhoof27-Jul-10 2:44 
AnswerRe: how to read MSDN documentation?? Pin
Richard MacCutchan26-Jul-10 11:35
mveRichard MacCutchan26-Jul-10 11:35 
GeneralRe: how to read MSDN documentation?? Pin
Bob100027-Jul-10 4:52
professionalBob100027-Jul-10 4:52 
AnswerRe: how to read MSDN documentation?? Pin
cruest27-Jul-10 3:26
cruest27-Jul-10 3:26 
AnswerRe: how to read MSDN documentation?? Pin
HenryChilvers27-Jul-10 5:29
HenryChilvers27-Jul-10 5:29 
AnswerRe: how to read MSDN documentation?? Pin
Richard MacCutchan27-Jul-10 5:55
mveRichard MacCutchan27-Jul-10 5:55 
AnswerRe: how to read MSDN documentation?? Pin
phicho29-Jul-10 4:14
phicho29-Jul-10 4:14 
AnswerRe: how to read MSDN documentation?? Pin
W Balboos, GHB4-Aug-10 4:42
W Balboos, GHB4-Aug-10 4:42 
QuestionLet me help..any one please Pin
krishna.p.vuppala26-Jul-10 8:51
krishna.p.vuppala26-Jul-10 8:51 
AnswerRe: Let me help..any one please Pin
Richard MacCutchan26-Jul-10 9:05
mveRichard MacCutchan26-Jul-10 9:05 
AnswerRe: Let me help..any one please Pin
Yusuf26-Jul-10 12:43
Yusuf26-Jul-10 12:43 
GeneralRe: Let me help..any one please Pin
krishna.p.vuppala26-Jul-10 16:47
krishna.p.vuppala26-Jul-10 16:47 
GeneralRe: Let me help..any one please Pin
Yusuf27-Jul-10 4:03
Yusuf27-Jul-10 4:03 
GeneralRe: Let me help..any one please Pin
patbob27-Jul-10 6:10
patbob27-Jul-10 6:10 
QuestionUser specified inheritance Pin
John R. Shaw26-Jul-10 6:47
John R. Shaw26-Jul-10 6:47 
I am reworking a template library that is VC++6.0 compatible, but I do not have access to that compiler at the moment.

Will the following test successfully compile and run on VC++6.0?
// JRS - 7.25.2010 - Test user specified inheritance
#include <cstdlib>
#include <iostream>

using namespace std;

template<typename CharT>
struct A
{
	CharT ch;
	A() : ch('A') {}
};

template<typename CharT, typename BaseT = A<CharT> >
struct B : public BaseT // user specified inheritance
{
	B() { BaseT::ch = 'B'; }
};

int main(int argc, char* argv[])
{
	A<char> a;
	B<char> b;

	cout << "a.ch = " << a.ch << endl;
	cout << "b.ch = " << b.ch << endl;

	system("PAUSE");
	return 0;
}

Curious?

I have 3 class templates that all have a “has-a” relationship with a data storage class template and I am changing it to an “is-a” relationship. But I still want the user to be able specify the storage class, as there are legitimate reasons why they may want to.

The above method solves the problem, but I have never seen it used by anyone else.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence." - Edsger Dijkstra
"I have never been lost, but I will admit to being confused for several weeks. " - Daniel Boone

AnswerRe: User specified inheritance Pin
David Crow26-Jul-10 7:32
David Crow26-Jul-10 7:32 
GeneralRe: User specified inheritance Pin
John R. Shaw26-Jul-10 7:50
John R. Shaw26-Jul-10 7:50 

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.