Click here to Skip to main content
15,881,898 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRedraw a CStatic,create it using Create,but the function DrawItem doesn't been run Pin
Member 1114733810-May-17 16:24
Member 1114733810-May-17 16:24 
AnswerRe: Redraw a CStatic,create it using Create,but the function DrawItem doesn't been run Pin
Jochen Arndt10-May-17 21:47
professionalJochen Arndt10-May-17 21:47 
Question[solved] Declare & Use Gobal Variable in C (Just like Singleton Variable) Pin
Django_Untaken9-May-17 1:42
Django_Untaken9-May-17 1:42 
AnswerRe: Declare & Use Gobal Variable in C (Just like Singleton Variable) Pin
Jochen Arndt9-May-17 2:32
professionalJochen Arndt9-May-17 2:32 
GeneralRe: Declare & Use Gobal Variable in C (Just like Singleton Variable) Pin
Django_Untaken9-May-17 3:10
Django_Untaken9-May-17 3:10 
AnswerRe: Declare & Use Gobal Variable in C (Just like Singleton Variable) Pin
Jochen Arndt9-May-17 3:15
professionalJochen Arndt9-May-17 3:15 
AnswerRe: [solved] Declare & Use Gobal Variable in C (Just like Singleton Variable) Pin
Richard MacCutchan9-May-17 4:49
mveRichard MacCutchan9-May-17 4:49 
AnswerRe: [solved] Declare & Use Gobal Variable in C (Just like Singleton Variable) Pin
Rick York12-May-17 7:19
mveRick York12-May-17 7:19 
Here's how I deal with global variables. I have one header file, I call Globals.h, with these definitions :

#ifdef DEFINE_GLOBALS
#define	Global
#define GlobalVar(Type,Variable,Value)		Type Variable=Value
#else
#define Global					extern
#define GlobalVar(Type,Variable,Value)		extern Type Variable
#endif


Then, in one and ONLY one file do this :

#define DEFINE_GLOBALS
#include "include "Globals.h"
#endif


before I include headers that define variables.

Here are some sample definitions :

typedef FILE * PFILE;

GlobalVar( PFILE, PtrLogFile, NULL );
GlobalVar( size_t, LineCount, 0 );

QuestionCTreeCtrl with CustomDraw Flickering Pin
SamwisePl5-May-17 0:29
SamwisePl5-May-17 0:29 
AnswerRe: CTreeCtrl with CustomDraw Flickering Pin
Richard MacCutchan5-May-17 0:58
mveRichard MacCutchan5-May-17 0:58 
GeneralRe: CTreeCtrl with CustomDraw Flickering Pin
SamwisePl5-May-17 1:17
SamwisePl5-May-17 1:17 
GeneralRe: CTreeCtrl with CustomDraw Flickering Pin
Richard MacCutchan5-May-17 1:48
mveRichard MacCutchan5-May-17 1:48 
AnswerRe: CTreeCtrl with CustomDraw Flickering Pin
Victor Nijegorodov5-May-17 6:00
Victor Nijegorodov5-May-17 6:00 
GeneralRe: CTreeCtrl with CustomDraw Flickering Pin
SamwisePl7-May-17 19:46
SamwisePl7-May-17 19:46 
AnswerRe: CTreeCtrl with CustomDraw Flickering Pin
leon de boer7-May-17 3:18
leon de boer7-May-17 3:18 
GeneralRe: CTreeCtrl with CustomDraw Flickering Pin
SamwisePl7-May-17 19:47
SamwisePl7-May-17 19:47 
AnswerRe: CTreeCtrl with CustomDraw Flickering Pin
SamwisePl15-May-17 19:15
SamwisePl15-May-17 19:15 
GeneralRe: CTreeCtrl with CustomDraw Flickering Pin
leon de boer15-May-17 19:26
leon de boer15-May-17 19:26 
QuestionWinBioIdentify() function causing to stop service "WbioSrvc " when match found? Pin
Premnath Mali4-May-17 19:28
professionalPremnath Mali4-May-17 19:28 
Questionambiguity in multiple inheritance Pin
Member 1315992028-Apr-17 20:17
Member 1315992028-Apr-17 20:17 
AnswerRe: ambiguity in multiple inheritance Pin
Richard MacCutchan28-Apr-17 21:34
mveRichard MacCutchan28-Apr-17 21:34 
AnswerRe: ambiguity in multiple inheritance Pin
Jochen Arndt28-Apr-17 21:44
professionalJochen Arndt28-Apr-17 21:44 
QuestionEmbedding Python in C++ Pin
Member 1312483628-Apr-17 17:06
Member 1312483628-Apr-17 17:06 
QuestionVisual studio Pin
Member 1315949628-Apr-17 11:06
Member 1315949628-Apr-17 11:06 
AnswerRe: Visual studio Pin
jeron128-Apr-17 11:14
jeron128-Apr-17 11:14 

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.