Click here to Skip to main content
16,016,814 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generaldialog Pin
danag7-Aug-02 13:13
danag7-Aug-02 13:13 
GeneralRe: dialog Pin
Chris Losinger7-Aug-02 13:15
professionalChris Losinger7-Aug-02 13:15 
GeneralRe: dialog Pin
danag7-Aug-02 14:04
danag7-Aug-02 14:04 
GeneralRe: dialog Pin
Chris Losinger7-Aug-02 15:06
professionalChris Losinger7-Aug-02 15:06 
GeneralRe: dialog Pin
Christian Graus7-Aug-02 13:24
protectorChristian Graus7-Aug-02 13:24 
GeneralRe: dialog Pin
danag7-Aug-02 13:26
danag7-Aug-02 13:26 
GeneralRe: dialog Pin
Christian Graus7-Aug-02 13:44
protectorChristian Graus7-Aug-02 13:44 
QuestionHow to implement Global Pointers ? Pin
oRion7-Aug-02 13:06
oRion7-Aug-02 13:06 
I have implemented global variables with the method that is going round this message board. That is to write a header file with all my global variables and a corresponding .cpp file to call it.

global.h

namespace myspace{

extern int myvar,*myptr;
}

global.cpp

int myspace::myvar,*myspace::myptr;

This work perfectly;), but I need my pointer to be initialize with new() statement for the first use. I would like to put it in the global.cpp file so that this is done automatically when this global file is being used. How do I do that?

Could I do it using Class ?? If the new() statement is implemented in the constructor, would this means every class derive from this Base Class, would call new() statement in the constructor? This means redudant memory allocation is done here?

Confused | :confused:
AnswerRe: How to implement Global Pointers ? Pin
Christian Graus7-Aug-02 13:13
protectorChristian Graus7-Aug-02 13:13 
GeneralRe: How to implement Global Pointers ? Pin
Anonymous8-Aug-02 17:59
Anonymous8-Aug-02 17:59 
AnswerRe: How to implement Global Pointers ? Pin
Chris Losinger7-Aug-02 13:14
professionalChris Losinger7-Aug-02 13:14 
AnswerRe: How to implement Global Pointers ? Pin
Todd Smith8-Aug-02 18:35
Todd Smith8-Aug-02 18:35 
GeneralRe: How to implement Global Pointers ? Pin
oRion9-Aug-02 4:43
oRion9-Aug-02 4:43 
GeneralParadox database ... Pin
Hadi Rezaee7-Aug-02 12:55
Hadi Rezaee7-Aug-02 12:55 
GeneralAccess DB Pin
alex.barylski7-Aug-02 12:00
alex.barylski7-Aug-02 12:00 
GeneralRe: Access DB Pin
Tomasz Sowinski7-Aug-02 12:13
Tomasz Sowinski7-Aug-02 12:13 
GeneralRe: Access DB Pin
alex.barylski7-Aug-02 12:30
alex.barylski7-Aug-02 12:30 
GeneralButton size Pin
orcun colak7-Aug-02 11:56
orcun colak7-Aug-02 11:56 
GeneralRe: Button size Pin
Christian Graus7-Aug-02 13:15
protectorChristian Graus7-Aug-02 13:15 
GeneralDeskband compilation weirdness Pin
User 66587-Aug-02 10:36
User 66587-Aug-02 10:36 
GeneralRe: Deskband compilation weirdness Pin
Anonymous7-Aug-02 10:39
Anonymous7-Aug-02 10:39 
GeneralRe: Deskband compilation weirdness Pin
User 66587-Aug-02 10:43
User 66587-Aug-02 10:43 
GeneralRe: Deskband compilation weirdness Pin
Anonymous7-Aug-02 10:50
Anonymous7-Aug-02 10:50 
GeneralRe: Deskband compilation weirdness Pin
Anonymous7-Aug-02 10:55
Anonymous7-Aug-02 10:55 
GeneralRe: Deskband compilation weirdness Pin
Atlantys7-Aug-02 10:48
Atlantys7-Aug-02 10:48 

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.