Click here to Skip to main content
15,925,042 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSpawning a new frame within a CDialog's OnBnClickedOk() has the effect of making the new frame immediately go behind the main frame Pin
Sternocera9-Aug-08 14:12
Sternocera9-Aug-08 14:12 
QuestionRegOpenKey error i cant figure out Pin
locoone9-Aug-08 12:56
locoone9-Aug-08 12:56 
AnswerRe: RegOpenKey error i cant figure out Pin
David Crow9-Aug-08 16:23
David Crow9-Aug-08 16:23 
GeneralRe: RegOpenKey error i cant figure out [modified] Pin
locoone9-Aug-08 17:05
locoone9-Aug-08 17:05 
QuestionRe: RegOpenKey error i cant figure out Pin
Mark Salsbery10-Aug-08 8:03
Mark Salsbery10-Aug-08 8:03 
AnswerRe: RegOpenKey error i cant figure out Pin
Rob Manderson10-Aug-08 8:26
protectorRob Manderson10-Aug-08 8:26 
QuestionHaving problems with Templates Pin
BobInNJ9-Aug-08 4:05
BobInNJ9-Aug-08 4:05 
AnswerRe: Having problems with Templates Pin
Graham Shanks9-Aug-08 11:28
Graham Shanks9-Aug-08 11:28 
I've found this C++ Faq[^] helpfull on template linkage errors. I must admit that I usually put all the declarations in the header file myself to avoid the problems. Putting the declaration for operator << in the header file resolves the linker error.

I'm a bit puzzled why you bothered with the friend operator << at all, since you have a public printIt function, which presumably is called by the operator <<. The friend keyword allows the function access to the internals (private and protected) parts of the class, with a printIt method you don't need this.

You could get the same effect by putting a stand alone template function in the header instead, e.g.

template<class T>
ostream & operator << ( ostream &out, Polynomial<T> &poly )
{
  poly.printIt(out);
  return out;
}


Graham

Librarians rule, Ook!

GeneralRe: Having problems with Templates Pin
BobInNJ10-Aug-08 5:49
BobInNJ10-Aug-08 5:49 
QuestionWhat are the limits of the drawing area in GDI? Pin
g_sandipan9-Aug-08 3:57
g_sandipan9-Aug-08 3:57 
AnswerRe: What are the limits of the drawing area in GDI? Pin
Mark Salsbery9-Aug-08 5:54
Mark Salsbery9-Aug-08 5:54 
AnswerRe: What are the limits of the drawing area in GDI? Pin
Randor 10-Aug-08 6:36
professional Randor 10-Aug-08 6:36 
Questionchange the target of a reference Pin
George_George9-Aug-08 2:28
George_George9-Aug-08 2:28 
AnswerRe: change the target of a reference Pin
Mark Salsbery9-Aug-08 5:57
Mark Salsbery9-Aug-08 5:57 
GeneralRe: change the target of a reference Pin
George_George10-Aug-08 14:53
George_George10-Aug-08 14:53 
GeneralRe: change the target of a reference Pin
Mark Salsbery11-Aug-08 5:41
Mark Salsbery11-Aug-08 5:41 
GeneralRe: change the target of a reference Pin
George_George11-Aug-08 19:54
George_George11-Aug-08 19:54 
AnswerRe: change the target of a reference [modified] Pin
Jijo.Raj9-Aug-08 6:25
Jijo.Raj9-Aug-08 6:25 
GeneralRe: change the target of a reference Pin
Mark Salsbery9-Aug-08 11:28
Mark Salsbery9-Aug-08 11:28 
GeneralRe: change the target of a reference Pin
Jijo.Raj9-Aug-08 19:32
Jijo.Raj9-Aug-08 19:32 
GeneralRe: change the target of a reference Pin
George_George10-Aug-08 14:54
George_George10-Aug-08 14:54 
AnswerRe: change the target of a reference Pin
Smith#10-Aug-08 2:24
Smith#10-Aug-08 2:24 
GeneralRe: change the target of a reference Pin
George_George10-Aug-08 14:56
George_George10-Aug-08 14:56 
AnswerRe: change the target of a reference Pin
Nemanja Trifunovic10-Aug-08 12:10
Nemanja Trifunovic10-Aug-08 12:10 
GeneralRe: change the target of a reference Pin
George_George10-Aug-08 14:57
George_George10-Aug-08 14:57 

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.