Click here to Skip to main content
15,900,258 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: LNK2005 error - first program with classes Pin
senthryl13-Aug-06 5:44
senthryl13-Aug-06 5:44 
GeneralRe: LNK2005 error - first program with classes Pin
Chris Losinger13-Aug-06 8:41
professionalChris Losinger13-Aug-06 8:41 
GeneralRe: LNK2005 error - first program with classes Pin
Mike Dimmick13-Aug-06 5:28
Mike Dimmick13-Aug-06 5:28 
QuestionGetting friend member functions to work Pin
Joel Becker13-Aug-06 2:11
Joel Becker13-Aug-06 2:11 
AnswerRe: Getting friend member functions to work Pin
Mike Dimmick13-Aug-06 5:30
Mike Dimmick13-Aug-06 5:30 
GeneralRe: Getting friend member functions to work Pin
Joel Becker13-Aug-06 7:13
Joel Becker13-Aug-06 7:13 
AnswerRe: Getting friend member functions to work Pin
Bartosz Bien13-Aug-06 11:11
Bartosz Bien13-Aug-06 11:11 
GeneralRe: Getting friend member functions to work Pin
Joel Becker13-Aug-06 11:22
Joel Becker13-Aug-06 11:22 
Hey!

Ok, I do have the return types in my actual code (so I redid it below).
But here's the thing: CGradient is defined AFTER CImage (both within CGraphicsSystem). Could this be why I'm getting the 2 errors:

error C2245: nonexistent function 'CGraphicsSystem::CImage::DrawRectGradient' specified as friend
error C2511: 'DrawRectGradient' : overloaded member function 'void (struct QGame::QGRECT &,class QGame::CGraphicsSystem::CGradien
t &)' not found in 'QGame::CGraphicsSystem::CImage'
c:\documents and settings\joel&sophia\my documents\computers\programming\vc++\libs\qgamelib\include\qggraph.hpp(199) : see declaration of 'CImage'

? The thing is, if I define it BEFORE, then I get an error for using CImage before it was defined (for the "friend CImage::..." line). (Or maybe you were talking about the actual class declarations before the definitions. Anyway, please help! Thanks) Confused | :confused:

Here's again what I have

class CGraphicsSystem;
class CImage;
class CGradient;

class CGraphicsSystem
{
public:
class CImage
{
public:
... // public functions
void DrawRectGradient(RECT&, CGradient&);
};
class CGradient
{
... // public functions and protected member variables
friend void CImage::DrawRectGradient(RECT&, CGradient&);
};
};



Joel Becker
GeneralRe: Getting friend member functions to work [modified] Pin
Bartosz Bien13-Aug-06 11:47
Bartosz Bien13-Aug-06 11:47 
GeneralRe: Getting friend member functions to work Pin
Joel Becker13-Aug-06 12:22
Joel Becker13-Aug-06 12:22 
QuestionString problem [modified] Pin
73Zeppelin13-Aug-06 1:28
73Zeppelin13-Aug-06 1:28 
GeneralRe: String problem Pin
ovidiucucu13-Aug-06 2:40
ovidiucucu13-Aug-06 2:40 
QuestionHow to print the text in the new line of a multi line edit box . Pin
VCSharp00713-Aug-06 1:02
VCSharp00713-Aug-06 1:02 
AnswerRe: How to print the text in the new line of a multi line edit box . Pin
ovidiucucu13-Aug-06 2:44
ovidiucucu13-Aug-06 2:44 
GeneralRe: How to print the text in the new line of a multi line edit box . Pin
Bram van Kampen13-Aug-06 14:54
Bram van Kampen13-Aug-06 14:54 
QuestionProblem in using GDI+ Pin
Dhananjayak0212-Aug-06 23:44
Dhananjayak0212-Aug-06 23:44 
AnswerRe: Problem in using GDI+ Pin
Stick^13-Aug-06 0:38
Stick^13-Aug-06 0:38 
Questionplease help Pin
jitun_vcpp12-Aug-06 20:56
jitun_vcpp12-Aug-06 20:56 
JokeRe: please help Pin
ovidiucucu13-Aug-06 2:47
ovidiucucu13-Aug-06 2:47 
AnswerRe: please help Pin
Hamid_RT13-Aug-06 9:46
Hamid_RT13-Aug-06 9:46 
AnswerRe: please help Pin
Kevin McFarlane13-Aug-06 10:43
Kevin McFarlane13-Aug-06 10:43 
Questionsystem menu icon on dialog box Pin
Tara1412-Aug-06 20:18
Tara1412-Aug-06 20:18 
AnswerRe: system menu icon on dialog box Pin
Michael Dunn12-Aug-06 21:26
sitebuilderMichael Dunn12-Aug-06 21:26 
GeneralRe: system menu icon on dialog box Pin
Tara1412-Aug-06 22:35
Tara1412-Aug-06 22:35 
GeneralRe: system menu icon on dialog box Pin
premkamalg13-Aug-06 23:44
premkamalg13-Aug-06 23:44 

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.