Click here to Skip to main content
15,899,679 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionApplication encountered serious error when running on emulator in debug mode(S.O.S) Pin
ttarantula16-Oct-08 23:36
ttarantula16-Oct-08 23:36 
AnswerRe: Application encountered serious error when running on emulator in debug mode(S.O.S) Pin
Rajesh R Subramanian16-Oct-08 23:46
professionalRajesh R Subramanian16-Oct-08 23:46 
AnswerRe: Application encountered serious error when running on emulator in debug mode(S.O.S) Pin
Hamid_RT17-Oct-08 0:09
Hamid_RT17-Oct-08 0:09 
GeneralRe: Application encountered serious error when running on emulator in debug mode(S.O.S) Pin
ttarantula17-Oct-08 0:17
ttarantula17-Oct-08 0:17 
GeneralRe: Application encountered serious error when running on emulator in debug mode(S.O.S) Pin
Hamid_RT17-Oct-08 19:13
Hamid_RT17-Oct-08 19:13 
GeneralRe: Application encountered serious error when running on emulator in debug mode(S.O.S) Pin
ttarantula11-Nov-08 16:04
ttarantula11-Nov-08 16:04 
QuestionWhere should I define this. Pin
CodingLover16-Oct-08 22:54
CodingLover16-Oct-08 22:54 
AnswerRe: Where should I define this. Pin
Graham Shanks16-Oct-08 23:19
Graham Shanks16-Oct-08 23:19 
No - it can cause problems. If the header file is included in more than one source file (i.e. a body file) then the linker will complain about szTempFile being multiply defined (actual error will depend on your actual compiler). Effectively each body file gets its own variable with global scope called szTempFile. When the linker comes along it sees multiple versions of the variable and causes the error

The rule is that a variable name can be declared more than once but only defined once. The above line is a definition. Definitions should always live in the body files. If you want to share the variable between multiple body files then you need to include a declaration of the variable in the header file. You do this by putting the keyword extern in front of the declaration as follows

extern TCHAR szTempFile[MAX_PATH];


Graham

Librarians rule, Ook!

QuestionRe: Where should I define this. Pin
CodingLover16-Oct-08 23:25
CodingLover16-Oct-08 23:25 
AnswerRe: Where should I define this. Pin
Graham Shanks16-Oct-08 23:51
Graham Shanks16-Oct-08 23:51 
AnswerRe: Where should I define this. Pin
toxcct17-Oct-08 0:46
toxcct17-Oct-08 0:46 
AnswerRe: Where should I define this. Pin
Mark Salsbery17-Oct-08 5:48
Mark Salsbery17-Oct-08 5:48 
QuestionHow to know the mouse right clicking the cerain icon in the toolbar Pin
akira3216-Oct-08 21:29
akira3216-Oct-08 21:29 
QuestionHow to read Specific String from file [modified] Pin
lpVCcode16-Oct-08 20:37
lpVCcode16-Oct-08 20:37 
AnswerRe: How to read Specific String from file Pin
CPallini16-Oct-08 21:31
mveCPallini16-Oct-08 21:31 
GeneralRe: How to read Specific String from file Pin
Mark Salsbery17-Oct-08 7:01
Mark Salsbery17-Oct-08 7:01 
AnswerRe: How to read Specific String from file Pin
Hamid_RT17-Oct-08 0:11
Hamid_RT17-Oct-08 0:11 
AnswerRe: How to read Specific String from file Pin
David Crow17-Oct-08 3:57
David Crow17-Oct-08 3:57 
Questionstatus of printer on network............... Pin
ani_ikram16-Oct-08 20:22
ani_ikram16-Oct-08 20:22 
AnswerRe: status of printer on network............... Pin
SandipG 16-Oct-08 20:54
SandipG 16-Oct-08 20:54 
GeneralRe: status of printer on network............... Pin
ani_ikram16-Oct-08 21:02
ani_ikram16-Oct-08 21:02 
QuestionRe: status of printer on network............... Pin
David Crow17-Oct-08 3:58
David Crow17-Oct-08 3:58 
QuestionRegarding Admin rights user Pin
H4u3216-Oct-08 20:13
H4u3216-Oct-08 20:13 
QuestionRe: Regarding Admin rights user Pin
David Crow17-Oct-08 4:00
David Crow17-Oct-08 4:00 
AnswerRe: Regarding Admin rights user Pin
H4u3217-Oct-08 4:50
H4u3217-Oct-08 4: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.