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

C / C++ / MFC

 
GeneralRe: browsing DLL resource files through CFileDialog Pin
Ryan Binns12-Jan-05 17:06
Ryan Binns12-Jan-05 17:06 
GeneralWinsock recv help Pin
KnaveR77712-Jan-05 7:19
KnaveR77712-Jan-05 7:19 
GeneralRe: Winsock recv help Pin
greba12-Jan-05 7:58
greba12-Jan-05 7:58 
GeneralRe: Winsock recv help Pin
KnaveR77712-Jan-05 9:15
KnaveR77712-Jan-05 9:15 
GeneralRe: Winsock recv help Pin
greba12-Jan-05 9:27
greba12-Jan-05 9:27 
GeneralSelecting columns of text in RichEdit Pin
Ed K12-Jan-05 6:53
Ed K12-Jan-05 6:53 
GeneralUse of extern Question. Pin
jerry1211a12-Jan-05 5:36
jerry1211a12-Jan-05 5:36 
GeneralRe: Use of extern Question. Pin
greba12-Jan-05 7:12
greba12-Jan-05 7:12 
A way to test for the existence of int socket1 in file1 would be use the preprocessor directives:

<br />
#ifdef socket1<br />
extern int socket1;<br />
#endif<br />


This will tell the preproccesor (what happens before compilation) to only use the code contained between "#ifdef socket1" and "#endif". If socket1 isn't defined (in file2) then the code between the preproccesor directives will not be compiled at all.

You will have to be careful though. Assuming you have code that used socket1 in file1 then you will get compile errors saying that socket1 isn't defined. To combat this you can do the following:

<br />
#ifdef socket1<br />
extern int socket1;<br />
#else<br />
int socket1;<br />
#endif<br />


I believe that answers your question.

Greba,

My lack of content on my home page should be entertaining.
GeneralRe: Use of extern Question. Pin
Michael Dunn12-Jan-05 10:28
sitebuilderMichael Dunn12-Jan-05 10:28 
GeneralF6 Not Working Pin
LittleYellowBird12-Jan-05 5:18
LittleYellowBird12-Jan-05 5:18 
GeneralRe: F6 Not Working Pin
Neville Franks12-Jan-05 8:54
Neville Franks12-Jan-05 8:54 
GeneralRe: F6 Not Working Pin
LittleYellowBird12-Jan-05 21:31
LittleYellowBird12-Jan-05 21:31 
GeneralUse Regular expression in VC 6 Pin
cop112-Jan-05 5:10
cop112-Jan-05 5:10 
GeneralRe: Use Regular expression in VC 6 Pin
User 665812-Jan-05 7:09
User 665812-Jan-05 7:09 
GeneralCreating a window transparent to mouse clicks Pin
Anonymous.12-Jan-05 4:53
sussAnonymous.12-Jan-05 4:53 
GeneralFlash and MFC Pin
FayezElFar12-Jan-05 4:36
FayezElFar12-Jan-05 4:36 
GeneralRe: Flash and MFC Pin
Anonymous.12-Jan-05 5:01
sussAnonymous.12-Jan-05 5:01 
GeneralSuppress Reboot when starting exe Pin
immes12-Jan-05 4:33
immes12-Jan-05 4:33 
QuestionResolving * and ? Pin
Joel Holdsworth12-Jan-05 3:03
Joel Holdsworth12-Jan-05 3:03 
AnswerRe: Resolving * and ? Pin
basementman12-Jan-05 3:58
basementman12-Jan-05 3:58 
GeneralUI design...! Pin
Feroz R12-Jan-05 2:20
Feroz R12-Jan-05 2:20 
GeneralRe: UI design...! Pin
Selvam R12-Jan-05 2:46
professionalSelvam R12-Jan-05 2:46 
GeneralCStatusBar help (new to VC++) Pin
LighthouseJ12-Jan-05 2:18
LighthouseJ12-Jan-05 2:18 
GeneralRe: CStatusBar help (new to VC++) Pin
RChin12-Jan-05 2:49
RChin12-Jan-05 2:49 
GeneralRe: CStatusBar help (new to VC++) Pin
LighthouseJ12-Jan-05 3:00
LighthouseJ12-Jan-05 3:00 

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.