Click here to Skip to main content
16,011,996 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: A class method definition in a header file... just one problem. Pin
Tomasz Morawski2-Jul-08 0:53
Tomasz Morawski2-Jul-08 0:53 
GeneralRe: A class method definition in a header file... just one problem. Pin
Tomasz Morawski2-Jul-08 0:54
Tomasz Morawski2-Jul-08 0:54 
GeneralRe: A class method definition in a header file... just one problem. Pin
Bram van Kampen2-Jul-08 11:24
Bram van Kampen2-Jul-08 11:24 
GeneralRe: A class method definition in a header file... just one problem. Pin
Tomasz Morawski3-Jul-08 8:13
Tomasz Morawski3-Jul-08 8:13 
GeneralRe: A class method definition in a header file... just one problem. Pin
Bram van Kampen3-Jul-08 8:28
Bram van Kampen3-Jul-08 8:28 
GeneralRe: A class method definition in a header file... just one problem. [modified] Pin
Tomasz Morawski3-Jul-08 8:41
Tomasz Morawski3-Jul-08 8:41 
GeneralRe: A class method definition in a header file... just one problem. Pin
Bram van Kampen3-Jul-08 10:42
Bram van Kampen3-Jul-08 10:42 
GeneralRe: A class method definition in a header file... just one problem. Pin
Tomasz Morawski3-Jul-08 21:06
Tomasz Morawski3-Jul-08 21:06 
#ifdef BUILD_DLL
#define LINKAGE __declspec(dllexport)
#else
#define LINKAGE __declspec(dllimport)
#endif


Yes, yes... I didn't write that but I know that... I use some think like that in my project.

I can not do that in this way that you propose. If I do that I will need to edit about teen files... this is to much work for me Frown | :( and doesn't look good. But your idea is very good... Big Grin | :-D I learnt a lot from you.

I found another way to resolve my problem.

#ifndef __A_H_INCLUDE__
#define __A_H_INCLUDE__

class B;

class A
{

   friend D;

   public:
      A( B* b )
         : bb( b )
      {
      }

      virtual void foo()
	{
		if ( d )
			d->foo( bb, this );
	}		
	
   protected:
	D *d;
	B *bb;
};
#endif


This some kind of delegation I think. Delegation is a idiom of C++ and that is ok. D class is not a stupid class hire. D class has a some sense. Do you like this idea? Is this good and look for professional code? I need to delegate about seven function.

Regards.
GeneralRe: A class method definition in a header file... just one problem. Pin
Bram van Kampen5-Jul-08 15:13
Bram van Kampen5-Jul-08 15:13 
AnswerRe: A class method definition in a header file... just one problem. Pin
Bram van Kampen1-Jul-08 21:55
Bram van Kampen1-Jul-08 21:55 
AnswerRe: A class method definition in a header file... just one problem. Pin
Stephen Hewitt1-Jul-08 14:11
Stephen Hewitt1-Jul-08 14:11 
QuestionHow to add a tag <tag val="N"> to an xml file Pin
SWDevil1-Jul-08 6:28
SWDevil1-Jul-08 6:28 
AnswerRe: How to add a tag <tag val="N"> to an xml file</tag> Pin
led mike1-Jul-08 7:47
led mike1-Jul-08 7:47 
GeneralRe: How to add a tag to an xml file Pin
SWDevil1-Jul-08 8:58
SWDevil1-Jul-08 8:58 
GeneralRe: How to add a tag to an xml file Pin
led mike1-Jul-08 11:05
led mike1-Jul-08 11:05 
QuestionOnly max & close button on CMDIChild window Pin
jigna gala1-Jul-08 2:55
jigna gala1-Jul-08 2:55 
AnswerRe: Only max & close button on CMDIChild window Pin
David Crow1-Jul-08 4:03
David Crow1-Jul-08 4:03 
Questiondll problem Pin
rjkg1-Jul-08 2:42
rjkg1-Jul-08 2:42 
AnswerRe: dll problem Pin
CPallini1-Jul-08 3:08
mveCPallini1-Jul-08 3:08 
GeneralRe: dll problem Pin
Hamid_RT1-Jul-08 20:23
Hamid_RT1-Jul-08 20:23 
GeneralRe: dll problem Pin
CPallini1-Jul-08 21:33
mveCPallini1-Jul-08 21:33 
GeneralRe: dll problem Pin
Hamid_RT1-Jul-08 21:46
Hamid_RT1-Jul-08 21:46 
GeneralRe: dll problem Pin
Rajesh R Subramanian3-Jul-08 22:35
professionalRajesh R Subramanian3-Jul-08 22:35 
AnswerRe: dll problem Pin
Stephen Hewitt1-Jul-08 14:18
Stephen Hewitt1-Jul-08 14:18 
QuestionRe: dll problem Pin
rjkg1-Jul-08 18:50
rjkg1-Jul-08 18: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.