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

C / C++ / MFC

 
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 
Question(MFC Feature Pack) CMFCPropertyGridFileProperty question Pin
Maximilien26-Jul-10 5:23
Maximilien26-Jul-10 5:23 
AnswerRe: (MFC Feature Pack) CMFCPropertyGridFileProperty question Pin
Eugen Podsypalnikov26-Jul-10 7:58
Eugen Podsypalnikov26-Jul-10 7:58 
GeneralRe: (MFC Feature Pack) CMFCPropertyGridFileProperty question Pin
Maximilien26-Jul-10 10:07
Maximilien26-Jul-10 10:07 
Questiondelete Syntax Pin
T.RATHA KRISHNAN26-Jul-10 2:13
T.RATHA KRISHNAN26-Jul-10 2:13 
AnswerRe: delete Syntax Pin
Cedric Moonen26-Jul-10 2:17
Cedric Moonen26-Jul-10 2:17 
GeneralRe: delete Syntax Pin
T.RATHA KRISHNAN26-Jul-10 2:22
T.RATHA KRISHNAN26-Jul-10 2:22 
GeneralRe: delete Syntax Pin
Cedric Moonen26-Jul-10 2:29
Cedric Moonen26-Jul-10 2:29 
GeneralRe: delete Syntax Pin
Maximilien26-Jul-10 2:31
Maximilien26-Jul-10 2:31 
GeneralRe: delete Syntax Pin
Cedric Moonen26-Jul-10 2:38
Cedric Moonen26-Jul-10 2:38 
AnswerRe: delete Syntax Pin
Aescleal26-Jul-10 2:24
Aescleal26-Jul-10 2:24 
QuestionHow to create Multiple instance of Simple Windows Services? [modified] Pin
Game-point26-Jul-10 1:21
Game-point26-Jul-10 1:21 
AnswerRe: How to create Multiple instance of Simple Windows Services? Pin
norish26-Jul-10 3:51
norish26-Jul-10 3:51 
QuestionError while adding ON_BN_CLICKED event. Pin
Deepu Antony25-Jul-10 23:26
Deepu Antony25-Jul-10 23:26 
AnswerRe: Error while adding ON_BN_CLICKED event. Pin
ThatsAlok25-Jul-10 23:56
ThatsAlok25-Jul-10 23:56 
GeneralRe: Error while adding ON_BN_CLICKED event. Pin
Deepu Antony26-Jul-10 0:07
Deepu Antony26-Jul-10 0:07 

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.