Click here to Skip to main content
15,908,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to hide internal component of a class Pin
Cedric Moonen15-Jan-09 0:51
Cedric Moonen15-Jan-09 0:51 
GeneralRe: how to hide internal component of a class Pin
Stephen Hewitt15-Jan-09 2:29
Stephen Hewitt15-Jan-09 2:29 
GeneralRe: how to hide internal component of a class Pin
sashoalm15-Jan-09 2:59
sashoalm15-Jan-09 2:59 
GeneralRe: how to hide internal component of a class Pin
Stephen Hewitt15-Jan-09 3:06
Stephen Hewitt15-Jan-09 3:06 
AnswerRe: how to hide internal component of a class Pin
Cedric Moonen15-Jan-09 0:49
Cedric Moonen15-Jan-09 0:49 
QuestionRe: how to hide internal component of a class Pin
SandipG 15-Jan-09 1:04
SandipG 15-Jan-09 1:04 
AnswerRe: how to hide internal component of a class Pin
pedefetoll15-Jan-09 1:11
pedefetoll15-Jan-09 1:11 
GeneralRe: how to hide internal component of a class Pin
Cedric Moonen15-Jan-09 1:16
Cedric Moonen15-Jan-09 1:16 
marcelcerdanjunior wrote:
I want that the user of MyClass.h doesn't need to have access to all other includes files like classComponent.h


That's the only thing you want to do, remove the #include statement at the top of your .h file ? It's completely different than what you said in your first message: you don't need to hide anything at all.
Instead of using an instance of the class, simply use a pointer to the class. This way, you only need to add a forward declaration at the top of your .h file and put the include directive in the .cpp file. A forward declaration is something like this:

class Component;

For more information, google for forward declaration.

EDIT: when thinking a bit about your question, in fact what you want to avoid is that the user of your class do not need to have all those include files on their system when they want to use your class ? Is that your problem ? If yes, then the only way is to provide compiled code (a lib file or a dll) to your user. Because if you move the include into the cpp file, the user will still need to compile the cpp file you provide and this will require the inclusion of the header file.

Cédric Moonen
Software developer

Charting control [v1.5]
OpenGL game tutorial in C++

GeneralRe: how to hide internal component of a class Pin
pedefetoll15-Jan-09 1:22
pedefetoll15-Jan-09 1:22 
GeneralRe: how to hide internal component of a class Pin
Cedric Moonen15-Jan-09 1:24
Cedric Moonen15-Jan-09 1:24 
AnswerRe: how to hide internal component of a class Pin
Stuart Dootson15-Jan-09 9:15
professionalStuart Dootson15-Jan-09 9:15 
Questionhelp on dynamic array (matix) Pin
Member 465588514-Jan-09 23:24
Member 465588514-Jan-09 23:24 
QuestionRe: help on dynamic array (matix) Pin
CPallini14-Jan-09 23:50
mveCPallini14-Jan-09 23:50 
AnswerRe: help on dynamic array (matix) Pin
Member 465588515-Jan-09 0:12
Member 465588515-Jan-09 0:12 
GeneralRe: help on dynamic array (matix) Pin
Iain Clarke, Warrior Programmer15-Jan-09 0:29
Iain Clarke, Warrior Programmer15-Jan-09 0:29 
GeneralRe: help on dynamic array (matix) Pin
CPallini15-Jan-09 1:50
mveCPallini15-Jan-09 1:50 
GeneralRe: help on dynamic array (matix) Pin
Cedric Moonen15-Jan-09 2:43
Cedric Moonen15-Jan-09 2:43 
GeneralRe: help on dynamic array (matix) Pin
CPallini15-Jan-09 2:57
mveCPallini15-Jan-09 2:57 
GeneralRe: help on dynamic array (matix) Pin
Cedric Moonen15-Jan-09 3:00
Cedric Moonen15-Jan-09 3:00 
GeneralRe: help on dynamic array (matix) Pin
CPallini15-Jan-09 3:31
mveCPallini15-Jan-09 3:31 
GeneralRe: help on dynamic array (matix) Pin
Randor 15-Jan-09 3:53
professional Randor 15-Jan-09 3:53 
GeneralRe: help on dynamic array (matix) Pin
Iain Clarke, Warrior Programmer15-Jan-09 6:16
Iain Clarke, Warrior Programmer15-Jan-09 6:16 
AnswerRe: help on dynamic array (matix) Pin
Iain Clarke, Warrior Programmer14-Jan-09 23:53
Iain Clarke, Warrior Programmer14-Jan-09 23:53 
GeneralRe: help on dynamic array (matix) Pin
Member 465588515-Jan-09 6:01
Member 465588515-Jan-09 6:01 
GeneralRe: help on dynamic array (matix) Pin
Iain Clarke, Warrior Programmer15-Jan-09 6:35
Iain Clarke, Warrior Programmer15-Jan-09 6:35 

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.