Click here to Skip to main content
16,008,750 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to modify DocString at runtime? Pin
Tomasz Sowinski10-Jul-01 0:42
Tomasz Sowinski10-Jul-01 0:42 
GeneralRe: How to modify DocString at runtime? Pin
10-Jul-01 3:01
suss10-Jul-01 3:01 
GeneralCustom Drawn Close, Maximize and Minimize buttons Pin
Andreas Philipson9-Jul-01 20:29
Andreas Philipson9-Jul-01 20:29 
GeneralRe: Custom Drawn Close, Maximize and Minimize buttons Pin
9-Jul-01 23:39
suss9-Jul-01 23:39 
GeneralRe: Custom Drawn Close, Maximize and Minimize buttons Pin
Andreas Philipson9-Jul-01 23:43
Andreas Philipson9-Jul-01 23:43 
QuestionHow to broadcast in same LAN with Socket? Pin
9-Jul-01 19:48
suss9-Jul-01 19:48 
AnswerRe: How to broadcast in same LAN with Socket? Pin
markkuk9-Jul-01 20:49
markkuk9-Jul-01 20:49 
QuestionTemplates errors I found and fix. But a quest...Why the errors? Pin
CMFC6.0VS.NETUser9-Jul-01 18:33
CMFC6.0VS.NETUser9-Jul-01 18:33 
I have a template class(my 2nd one) that I am using here the code that give me error and the error latter.

class UseClassMemebersInTemplate
{
public:
void Build(){...};
void Kill();
...
};

template<Type& T>
class TemplateClass
{
public:
TemplateClass()
{
CallAFunctionInConstructor();
}

~TemplateClass()
{
CallAnotherFunctionInConstructor();
}

void CallAFunctionInConstructor()
{
T.Build();
}

void CallAnotherFunctionInConstructor()
{
T.Kill();
}
};

...
//In Another class same header file futher to EOF
...
TemplateClass<UseClassMemebersInTemplate> NewObj;




///////////
When the above is build in VC++ 6.0

I get a couple of errors one looks like...
"missing a ';' before '.'"

At one time I had the calls to Build() and Kill() but empty template constructor and destructor. So I comment constructor and destructor bodies and I was able to build it fine.

I was looking at my 1st template class that I build a year or two ago which applied to the class above modifiy only three places in the template. Keep in mind I going back to the code that gave me the errors. Here the changes I made...

1. Added a pointer to T as a memeber to the template call. Like "T* pT;".
2. Changed both call to Build() and Kill() from "T.Build();" and "T.Kill();" to "pT->Build();" and "pT->Kill();"

And it works find. I can live with calling w/ a pointer but if anyone know why I can use "T." please let me know why not.
AnswerRe: Templates errors I found and fix. But a quest...Why the errors? Pin
9-Jul-01 19:36
suss9-Jul-01 19:36 
GeneralRe: Templates errors I found and fix. But a quest...Why the errors? Pin
9-Jul-01 21:55
suss9-Jul-01 21:55 
AnswerRe: Templates errors I found and fix. But a quest...Why the errors? Pin
CMFC6.0VS.NETUser10-Jul-01 4:46
CMFC6.0VS.NETUser10-Jul-01 4:46 
GeneralCArchive Pin
XioPeng9-Jul-01 14:52
XioPeng9-Jul-01 14:52 
GeneralRe: CArchive Pin
markkuk9-Jul-01 20:57
markkuk9-Jul-01 20:57 
GeneralQuick question Pin
RobJones9-Jul-01 12:48
RobJones9-Jul-01 12:48 
GeneralRe: Quick question Pin
Ben Burnett9-Jul-01 19:50
Ben Burnett9-Jul-01 19:50 
GeneralRe: Quick question Pin
RobJones10-Jul-01 5:06
RobJones10-Jul-01 5:06 
GeneralBeginner's Question Pin
Sara9-Jul-01 11:45
Sara9-Jul-01 11:45 
GeneralRe: Beginner's Question Pin
Ben Burnett9-Jul-01 12:07
Ben Burnett9-Jul-01 12:07 
GeneralRe: Beginner's Question Pin
10-Jul-01 0:04
suss10-Jul-01 0:04 
GeneralRe: Beginner's Question Pin
Masaaki Onishi9-Jul-01 14:01
Masaaki Onishi9-Jul-01 14:01 
GeneralMP3 reading Pin
Matt Newman9-Jul-01 11:09
Matt Newman9-Jul-01 11:09 
GeneralRe: MP3 reading Pin
Christian Graus9-Jul-01 12:38
protectorChristian Graus9-Jul-01 12:38 
GeneralRe: MP3 reading Pin
Matt Newman9-Jul-01 15:47
Matt Newman9-Jul-01 15:47 
GeneralRe: MP3 reading Pin
Christian Graus9-Jul-01 15:55
protectorChristian Graus9-Jul-01 15:55 
GeneralRe: MP3 reading Pin
Matt Newman9-Jul-01 16:20
Matt Newman9-Jul-01 16: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.