Click here to Skip to main content
16,017,608 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: converting from const char [] to 'LPWSTR' Pin
Matthew Faithfull31-May-07 9:43
Matthew Faithfull31-May-07 9:43 
AnswerRe: converting from const char [] to 'LPWSTR' Pin
Xing Chen31-May-07 15:18
Xing Chen31-May-07 15:18 
QuestionGetDIBits() function call fails Pin
TheDelChop31-May-07 8:50
TheDelChop31-May-07 8:50 
AnswerRe: GetDIBits() function call fails Pin
John R. Shaw31-May-07 9:17
John R. Shaw31-May-07 9:17 
AnswerRe: GetDIBits() function call fails Pin
Mark Salsbery31-May-07 9:30
Mark Salsbery31-May-07 9:30 
QuestionNewbie Question Pin
joshp121731-May-07 8:45
joshp121731-May-07 8:45 
AnswerRe: Newbie Question Pin
David Crow31-May-07 10:31
David Crow31-May-07 10:31 
AnswerRe: Newbie Question Pin
Matthew Faithfull31-May-07 11:10
Matthew Faithfull31-May-07 11:10 
Remember to make sure that all the files that use a type ( e.g card class ) have a #include line that references the file that defines the type.
If card is defined in card.h then deck.cpp might look something like this.

<br />
//deck.cpp<br />
<br />
#include "card.h"<br />
<br />
<br />
deck::deck()<br />
{<br />
  card the_cards[52];//An array of 52 cards for the deck<br />
}<br />


If the definition of deck itself, in deck.h, depends on the definition of card then it's deck.h that should #include "card.h"

Think of it as, when the compiler sees #include "card.h" it goes and reads the card.h file and after that it knows about the card class otherwise it's as if it never heard of it.
The trick is that every time it moves on to compiling a different .cpp file (compilation unit) it forgets everything it found out before and starts again knowning nothing except C++. Sounds dumb but it really works Wink | ;)



Nothing is exactly what it seems but everything with seems can be unpicked.

GeneralRe: Newbie Question Pin
joshp121731-May-07 11:15
joshp121731-May-07 11:15 
GeneralRe: Newbie Question Pin
Matthew Faithfull31-May-07 11:37
Matthew Faithfull31-May-07 11:37 
Question64 bit XP Pin
Monty231-May-07 7:40
Monty231-May-07 7:40 
AnswerSolution for those interested Pin
Monty231-May-07 22:41
Monty231-May-07 22:41 
GeneralRe: Solution for those interested Pin
Mark Salsbery1-Jun-07 6:22
Mark Salsbery1-Jun-07 6:22 
QuestionRegistry vs .Ini files. Pin
Anurag Gandhi31-May-07 7:37
professionalAnurag Gandhi31-May-07 7:37 
AnswerRe: Registry vs .Ini files. Pin
David Crow31-May-07 7:57
David Crow31-May-07 7:57 
GeneralRe: Registry vs .Ini files. Pin
Anurag Gandhi31-May-07 8:00
professionalAnurag Gandhi31-May-07 8:00 
QuestionRe: Registry vs .Ini files. Pin
David Crow31-May-07 8:15
David Crow31-May-07 8:15 
AnswerRe: Registry vs .Ini files. Pin
Anurag Gandhi31-May-07 8:17
professionalAnurag Gandhi31-May-07 8:17 
GeneralRe: Registry vs .Ini files. Pin
Maximilien31-May-07 8:45
Maximilien31-May-07 8:45 
GeneralRe: Registry vs .Ini files. Pin
David Crow31-May-07 8:45
David Crow31-May-07 8:45 
GeneralRe: Registry vs .Ini files. Pin
Matthew Faithfull31-May-07 8:25
Matthew Faithfull31-May-07 8:25 
GeneralRe: Registry vs .Ini files. Pin
Anurag Gandhi31-May-07 8:35
professionalAnurag Gandhi31-May-07 8:35 
AnswerRe: Registry vs .Ini files. Pin
#realJSOP1-Jun-07 3:21
professional#realJSOP1-Jun-07 3:21 
QuestionAnyone know of a VS2005 add-in to do this? Pin
Stick^31-May-07 6:45
Stick^31-May-07 6:45 
QuestionRe: Anyone know of a VS2005 add-in to do this? Pin
David Crow31-May-07 8:13
David Crow31-May-07 8:13 

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.