Re: Using a extern variable
From: Andre Oschadlin (dspipeline_at_hotmail.com)
Date: 12/06/04
- Next message: Gnum: "Re: How to develop a PPC application"
- Previous message: rockone: "Re: WinCE Clipboard how to"
- In reply to: iLLiDaN: "Using a extern variable"
- Next in thread: Fat Controller: "Re: Using a extern variable"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 6 Dec 2004 12:16:16 +1000
I would have created a class, say CGlobals, which all of your program can
include using an extern statement.
Then place all of your global variables within that class. Then you can
also do any special initialisation and clean up if needed using the CGlobals
constructor and destructor.
This also cleans up any linker errors. :-)
My guess is that you haven't actually defined the global variables anywhere,
but you just happened to have an 'int count' defined somewhere. Check for
where you've actually defined all of the variables.
Andre
"iLLiDaN" <iLLiDaN@discussions.microsoft.com> wrote in message
news:9FBDF155-CD77-45A9-88E9-B87AD593DC1C@microsoft.com...
> Hi, I need to use a global integer and CString variables in a project. I'm
> using EVC++. I have a globals.h where I put:
> //////////////////////
> #ifndef __GLOBALS__
> #define __GLOBALS__
> extern int count;
> extern CString StrComPort, name;
> #endif
> ////////////////////
>
> The "count" variable can be accessed from any dialogs, but the CString
> variables make a Link error.
>
> How Can I get a CString variable which is globall to all the project??
> Thank you!.
- Next message: Gnum: "Re: How to develop a PPC application"
- Previous message: rockone: "Re: WinCE Clipboard how to"
- In reply to: iLLiDaN: "Using a extern variable"
- Next in thread: Fat Controller: "Re: Using a extern variable"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|