Click here to Skip to main content
15,910,234 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Adding a MFC ODBC Consumer class Pin
okonur4-Feb-07 9:26
okonur4-Feb-07 9:26 
GeneralRe: Adding a MFC ODBC Consumer class Pin
Mark Salsbery4-Feb-07 9:45
Mark Salsbery4-Feb-07 9:45 
GeneralRe: Adding a MFC ODBC Consumer class Pin
okonur4-Feb-07 10:02
okonur4-Feb-07 10:02 
GeneralRe: Adding a MFC ODBC Consumer class Pin
Mark Salsbery4-Feb-07 11:43
Mark Salsbery4-Feb-07 11:43 
GeneralRe: Adding a MFC ODBC Consumer class Pin
Hamid_RT5-Feb-07 6:53
Hamid_RT5-Feb-07 6:53 
GeneralRe: Adding a MFC ODBC Consumer class Pin
okonur9-Feb-07 3:32
okonur9-Feb-07 3:32 
GeneralRe: Adding a MFC ODBC Consumer class Pin
Hamid_RT9-Feb-07 5:22
Hamid_RT9-Feb-07 5:22 
AnswerRe: Adding a MFC ODBC Consumer class Pin
David Crow4-Feb-07 17:25
David Crow4-Feb-07 17:25 
GeneralRe: Adding a MFC ODBC Consumer class Pin
Mark Salsbery5-Feb-07 7:49
Mark Salsbery5-Feb-07 7:49 
GeneralRe: Adding a MFC ODBC Consumer class Pin
David Crow5-Feb-07 8:40
David Crow5-Feb-07 8:40 
QuestionMAPS Pin
sameer224-Feb-07 6:01
sameer224-Feb-07 6:01 
QuestionRe: MAPS Pin
Waldermort4-Feb-07 6:14
Waldermort4-Feb-07 6:14 
QuestionRe: MAPS Pin
sameer224-Feb-07 6:55
sameer224-Feb-07 6:55 
AnswerRe: MAPS Pin
Waldermort4-Feb-07 7:19
Waldermort4-Feb-07 7:19 
AnswerRe: MAPS Pin
Hamid_RT4-Feb-07 7:43
Hamid_RT4-Feb-07 7:43 
GeneralRe: MAPS Pin
sameer224-Feb-07 8:27
sameer224-Feb-07 8:27 
GeneralRe: MAPS Pin
Hamid_RT4-Feb-07 8:30
Hamid_RT4-Feb-07 8:30 
AnswerRe: MAPS Pin
ThatsAlok6-Feb-07 20:18
ThatsAlok6-Feb-07 20:18 
QuestionUnable to create an automation project using MFC and a type library Pin
milltooth4-Feb-07 5:35
milltooth4-Feb-07 5:35 
QuestionGlobal variables [modified] Pin
Makakuin4-Feb-07 5:05
Makakuin4-Feb-07 5:05 
Hi! I`m creating a dialog based application with one main dialog containing TabCtrl each of tabs in TabCtrl contain individual dialog. This application will be used for ticket printing in a museum and each tab is for different ticket type, where you will only need to enter the count of visitors. The ticket prices are held in a database. To avoid the need to access database each time the price of a ticket needs to be read, I want to create a global Struct variable, then on applications InitInstance() read the values in to that variable.

Example:
Struct prices<br />
   {<br />
     double price1;<br />
     double price2;<br />
     double price3;<br />
     double price4;<br />
   };<br />

I tried defining the struct in applications header file, then after class definition in same header I added line:

extern CMyApp::prices price;

Later in applications InitInstance() I call:

CMyApp::prices price;

That way I`m able to access price.price1, price.price2.. etc. in any class.

Iv`e heard about creating seperate class for global variables and then access them like CMyGlobals::Variable...
What is the best way of creating global variables? And what is your opinion of my solution.

Thanx!




-- modified at 11:10 Sunday 4th February, 2007
AnswerRe: Global variables Pin
Waldermort4-Feb-07 6:20
Waldermort4-Feb-07 6:20 
AnswerRe: Global variables Pin
ThatsAlok6-Feb-07 20:19
ThatsAlok6-Feb-07 20:19 
QuestionSaving with property sheet Pin
DanYELL4-Feb-07 4:53
DanYELL4-Feb-07 4:53 
AnswerRe: Saving with property sheet Pin
Mark Salsbery4-Feb-07 9:04
Mark Salsbery4-Feb-07 9:04 
Questionmotion detection Pin
ceejeeb4-Feb-07 3:54
ceejeeb4-Feb-07 3:54 

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.