Click here to Skip to main content
15,916,692 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: How to communicate with soundcard Pin
Mark Salsbery16-Jun-07 6:01
Mark Salsbery16-Jun-07 6:01 
AnswerRe: How to communicate with soundcard Pin
Max++16-Jun-07 6:55
Max++16-Jun-07 6:55 
GeneralRe: How to communicate with soundcard Pin
Mark Salsbery16-Jun-07 7:14
Mark Salsbery16-Jun-07 7:14 
QuestionUsing two different versions of same Visual studio dll Pin
Rose8116-Jun-07 2:37
Rose8116-Jun-07 2:37 
AnswerRe: Using two different versions of same Visual studio dll Pin
Mark Salsbery16-Jun-07 6:06
Mark Salsbery16-Jun-07 6:06 
QuestionAbout Intelliconnect-Registry Settings Pin
Akin Ocal16-Jun-07 2:25
Akin Ocal16-Jun-07 2:25 
QuestionLocalizing some extern/global vriables? Pin
granshah @ eVisionISF16-Jun-07 1:44
granshah @ eVisionISF16-Jun-07 1:44 
AnswerRe: Localizing some extern/global vriables? Pin
Matthew Faithfull16-Jun-07 2:27
Matthew Faithfull16-Jun-07 2:27 
I would start with something like

<br />
//shared.h<br />
<br />
class CMyOldGlobals<br />
{<br />
public:<br />
  static int AnExampleGlobal;<br />
};<br />


<br />
//initshared.cpp<br />
<br />
int CMyOldGlobals::AnExampleGlobal = DEFAULT_VALUE;<br />


remove the previous extern int AnExampleGlobal and definition of AnExampleGlobal.
#include shared.h wherever you need it and then a run through the compiler will list you all the places where AnExampleGlobal is used as being errors. You'll need to go through each one and change it to

<br />
CMyOldGlobals::AnExampleGlobal;<br />


This will remove all the old externs and global variables but it wont change the semantics of the code at all, the variables are still shared. If you then want to manage the sharing of this data between classes you'll need to do some data hiding and if multi threading is involved they'll all need sychronised access protection.
I hope this helps as a place to start anyway Smile | :)


Nothing is exactly what it seems but everything with seems can be unpicked.

Questionreading excel file through coding Pin
neha.agarwal2716-Jun-07 0:46
neha.agarwal2716-Jun-07 0:46 
GeneralRe: reading excel file through coding Pin
Matthew Faithfull16-Jun-07 1:55
Matthew Faithfull16-Jun-07 1:55 
GeneralRe: reading excel file through coding Pin
neha.agarwal2717-Jun-07 21:01
neha.agarwal2717-Jun-07 21:01 
AnswerRe: reading excel file through coding Pin
Matthew Faithfull17-Jun-07 22:30
Matthew Faithfull17-Jun-07 22:30 
AnswerRe: reading excel file through coding Pin
David Crow18-Jun-07 2:53
David Crow18-Jun-07 2:53 
QuestionTJFTP linking problem Pin
oaa.infocom16-Jun-07 0:17
oaa.infocom16-Jun-07 0:17 
AnswerRe: TJFTP linking problem Pin
Mark Salsbery16-Jun-07 6:34
Mark Salsbery16-Jun-07 6:34 
QuestionRe: TJFTP linking problem Pin
Hamid_RT16-Jun-07 9:27
Hamid_RT16-Jun-07 9:27 
Questionreading file failed.... Pin
Y_Kaushik16-Jun-07 0:01
Y_Kaushik16-Jun-07 0:01 
AnswerRe: reading file failed.... Pin
neha.agarwal2716-Jun-07 1:21
neha.agarwal2716-Jun-07 1:21 
GeneralRe: reading file failed.... Pin
Y_Kaushik16-Jun-07 1:34
Y_Kaushik16-Jun-07 1:34 
GeneralRe: reading file failed.... Pin
neha.agarwal2716-Jun-07 1:44
neha.agarwal2716-Jun-07 1:44 
GeneralRe: reading file failed.... Pin
Y_Kaushik16-Jun-07 2:08
Y_Kaushik16-Jun-07 2:08 
GeneralRe: reading file failed.... Pin
neha.agarwal2716-Jun-07 2:50
neha.agarwal2716-Jun-07 2:50 
GeneralRe: reading file failed.... Pin
Y_Kaushik16-Jun-07 3:36
Y_Kaushik16-Jun-07 3:36 
GeneralRe: reading file failed.... Pin
David Crow18-Jun-07 2:56
David Crow18-Jun-07 2:56 
QuestionCalling a Function in CMainFrame Pin
Abhijeet Pathak15-Jun-07 22:56
Abhijeet Pathak15-Jun-07 22:56 

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.