Click here to Skip to main content
15,893,381 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCab file Pin
benjnp13-Sep-05 16:27
benjnp13-Sep-05 16:27 
AnswerRe: Cab file Pin
Christian Graus13-Sep-05 16:53
protectorChristian Graus13-Sep-05 16:53 
GeneralRe: Cab file Pin
benjnp13-Sep-05 17:57
benjnp13-Sep-05 17:57 
QuestionGlobal variable prob Pin
benjnp13-Sep-05 16:24
benjnp13-Sep-05 16:24 
AnswerRe: Global variable prob Pin
Weiye Chen13-Sep-05 16:41
Weiye Chen13-Sep-05 16:41 
GeneralRe: Global variable prob Pin
benjnp13-Sep-05 17:59
benjnp13-Sep-05 17:59 
GeneralRe: Global variable prob Pin
HumanOsc13-Sep-05 23:17
HumanOsc13-Sep-05 23:17 
AnswerRe: Global variable prob Pin
Christian Graus13-Sep-05 16:50
protectorChristian Graus13-Sep-05 16:50 
Global variables are almost always a bad idea. You're better off creating a class with a static public variable. The main reason is that you have some ability to control/track access of the variable that way.

The easiest way to add a global is to declare it in your stdafx.cpp. You may need to declare it in stdafx.h, but I'm pretty sure from memory that stdafx.cpp is the place to make it visible across your app.


Christian Graus - Microsoft MVP - C++
GeneralRe: Global variable prob Pin
Weiye Chen13-Sep-05 16:54
Weiye Chen13-Sep-05 16:54 
GeneralRe: Global variable prob Pin
benjnp13-Sep-05 18:05
benjnp13-Sep-05 18:05 
GeneralRe: Global variable prob Pin
Christian Graus13-Sep-05 18:06
protectorChristian Graus13-Sep-05 18:06 
GeneralRe: Global variable prob Pin
benjnp13-Sep-05 18:09
benjnp13-Sep-05 18:09 
GeneralRe: Global variable prob Pin
Christian Graus13-Sep-05 18:10
protectorChristian Graus13-Sep-05 18:10 
GeneralRe: Global variable prob Pin
benjnp13-Sep-05 18:24
benjnp13-Sep-05 18:24 
GeneralRe: Global variable prob Pin
benjnp13-Sep-05 18:27
benjnp13-Sep-05 18:27 
GeneralRe: Global variable prob Pin
Weiye Chen13-Sep-05 20:17
Weiye Chen13-Sep-05 20:17 
GeneralRe: Global variable prob Pin
benjnp14-Sep-05 15:36
benjnp14-Sep-05 15:36 
QuestionGreat Trouble.Please, please Help. Even a simple link... Pin
Hamed Musavi13-Sep-05 16:01
Hamed Musavi13-Sep-05 16:01 
AnswerRe: Great Trouble.Please, please Help. Even a simple link... Pin
Christian Graus13-Sep-05 16:17
protectorChristian Graus13-Sep-05 16:17 
GeneralRe: Great Trouble.Please, please Help. Even a simple link... Pin
Hamed Musavi13-Sep-05 16:43
Hamed Musavi13-Sep-05 16:43 
GeneralRe: Great Trouble.Please, please Help. Even a simple link... Pin
Christian Graus13-Sep-05 16:45
protectorChristian Graus13-Sep-05 16:45 
GeneralRe: Great Trouble.Please, please Help. Even a simple link... Pin
Hamed Musavi13-Sep-05 16:58
Hamed Musavi13-Sep-05 16:58 
GeneralRe: Great Trouble.Please, please Help. Even a simple link... Pin
Christian Graus13-Sep-05 17:00
protectorChristian Graus13-Sep-05 17:00 
GeneralRe: Great Trouble.Please, please Help. Even a simple link... Pin
Hamed Musavi13-Sep-05 17:07
Hamed Musavi13-Sep-05 17:07 
AnswerRe: Great Trouble.Please, please Help. Even a simple link... Pin
charlieg13-Sep-05 17:15
charlieg13-Sep-05 17:15 

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.