Click here to Skip to main content
15,895,011 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: PVOID pBuffer; access to data :confused: Pin
ZoogieZork8-Oct-03 10:13
ZoogieZork8-Oct-03 10:13 
GeneralRe: PVOID pBuffer; access to data :confused: Pin
Bo Hunter8-Oct-03 10:31
Bo Hunter8-Oct-03 10:31 
GeneralRe: PVOID pBuffer; access to data :confused: Pin
Dave Harper8-Oct-03 11:36
Dave Harper8-Oct-03 11:36 
GeneralRe: PVOID pBuffer; access to data :confused: Pin
ZoogieZork8-Oct-03 12:43
ZoogieZork8-Oct-03 12:43 
GeneralRe: PVOID pBuffer; access to data :confused: Pin
Dave Harper8-Oct-03 13:07
Dave Harper8-Oct-03 13:07 
QuestionConsole c++ global class? Pin
immanis8-Oct-03 7:06
immanis8-Oct-03 7:06 
AnswerRe: Console c++ global class? Pin
Ryan_Roberts8-Oct-03 7:14
Ryan_Roberts8-Oct-03 7:14 
GeneralRe: Console c++ global class? Pin
immanis8-Oct-03 18:03
immanis8-Oct-03 18:03 
I declared a global static class, and it was indeed available to all objects. Thank you for the advice. Eventually I'll do the singleton method. The only problem now is, for some reason, objects are incapable of modifying public attributes or calling public methods of the global class.

Lets go back to my example. Before I had the global class, when constructing a "building" object, I had to pass it the myworld object constructor. The constructor would initialize certain variables, and call some initializing member functions. It would also call a member function of the myworld object, that would essentially(on the myworld object side) just increment the building count attribute of the world class. Before and after building object construction, I cout'ed myworld object's building count. It didnt change.
Now, with the static global object myworld, the results are the same. Myworld just refuses to change. Building has been made a friend class to the world class. In fact, nothing is private in the world class.

Just to check my coding, I called world class member functions and modified building counts directly from the main function, and it worked. It just doesnt seem to want to be modified by another object.

Any ideas?
AnswerRe: Console c++ global class? Pin
David Crow8-Oct-03 8:17
David Crow8-Oct-03 8:17 
GeneralSplitter Window Control Pin
Lea Hayes8-Oct-03 6:39
Lea Hayes8-Oct-03 6:39 
GeneralRe: Splitter Window Control Pin
David Crow8-Oct-03 6:43
David Crow8-Oct-03 6:43 
GeneralPrinting size -bmp-help needed! Pin
radha vijay8-Oct-03 5:25
radha vijay8-Oct-03 5:25 
GeneralRe: Printing size -bmp-help needed! Pin
David Crow8-Oct-03 6:45
David Crow8-Oct-03 6:45 
GeneralRe: Printing size -bmp-help needed! Pin
Alex Dolpfin9-Oct-03 3:49
Alex Dolpfin9-Oct-03 3:49 
GeneralRe: One application for two Operating Systems Pin
vcplusplus8-Oct-03 5:23
vcplusplus8-Oct-03 5:23 
Generaldisplaying of string in CEdit or CRichEditCtrl Pin
Neelesh K J Jain8-Oct-03 5:00
Neelesh K J Jain8-Oct-03 5:00 
GeneralRe: displaying of string in CEdit or CRichEditCtrl Pin
Niall Barr8-Oct-03 5:10
professionalNiall Barr8-Oct-03 5:10 
GeneralRe: displaying of string in CEdit or CRichEditCtrl Pin
David Crow8-Oct-03 6:46
David Crow8-Oct-03 6:46 
GeneralPrint Preview - Text extent differs at various zoom states Pin
Andy Latham8-Oct-03 4:43
Andy Latham8-Oct-03 4:43 
GeneralOne application for two Operating Systems Pin
ThakurSaab8-Oct-03 4:41
ThakurSaab8-Oct-03 4:41 
GeneralRe: One application for two Operating Systems Pin
Niall Barr8-Oct-03 4:57
professionalNiall Barr8-Oct-03 4:57 
GeneralGet license key Pin
Anonymous8-Oct-03 4:05
Anonymous8-Oct-03 4:05 
GeneralRe: Get license key Pin
Wes Aday8-Oct-03 4:38
professionalWes Aday8-Oct-03 4:38 
GeneralRe: Get license key Pin
Anonymous8-Oct-03 5:02
Anonymous8-Oct-03 5:02 
GeneralTransparent winows using a bitmap and UpdateLayeredWindow - HELP pls! Pin
xela8-Oct-03 3:49
xela8-Oct-03 3:49 

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.