Click here to Skip to main content
15,919,931 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: C/C++ directory traversal Pin
Mark Salsbery1-Apr-07 9:56
Mark Salsbery1-Apr-07 9:56 
GeneralRe: C/C++ directory traversal Pin
xalspaero1-Apr-07 11:48
xalspaero1-Apr-07 11:48 
Questionerror C2143 with AfxGetApp() Pin
dreamtwister1-Apr-07 8:17
dreamtwister1-Apr-07 8:17 
AnswerRe: error C2143 with AfxGetApp() Pin
CPallini1-Apr-07 8:45
mveCPallini1-Apr-07 8:45 
GeneralRe: error C2143 with AfxGetApp() Pin
dreamtwister1-Apr-07 9:16
dreamtwister1-Apr-07 9:16 
GeneralRe: error C2143 with AfxGetApp() Pin
CPallini1-Apr-07 10:01
mveCPallini1-Apr-07 10:01 
GeneralRe: error C2143 with AfxGetApp() Pin
dreamtwister1-Apr-07 10:19
dreamtwister1-Apr-07 10:19 
GeneralRe: error C2143 with AfxGetApp() Pin
cp98761-Apr-07 15:53
cp98761-Apr-07 15:53 
What I find is useful when I store info in MyApp is to add:

to MyApp.h
    CMyApp* GetMyApp();

and for some common functions or global settings (if req'd)
    void CommonAppFunction(something);




and to MyApp.cpp
CMyApp* GetMyApp()
	{
	return &theApp;
	}

void CommonAppFunction(something)
	{
	return theApp.CommonAppFunction(something);
	}


This enables you to write in any file that includes MyApp.h

GetMyApp()->DoSomething();

or
CommonAppFunction(something);


and saves all the casting etc.





Peter

"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."

AnswerRe: error C2143 with AfxGetApp() Pin
Michael Dunn1-Apr-07 9:24
sitebuilderMichael Dunn1-Apr-07 9:24 
GeneralRe: error C2143 with AfxGetApp() Pin
dreamtwister1-Apr-07 9:30
dreamtwister1-Apr-07 9:30 
Questiontcp in C++? Pin
mmavipc1-Apr-07 8:00
mmavipc1-Apr-07 8:00 
AnswerRe: tcp in C++? Pin
Hamed Musavi1-Apr-07 8:50
Hamed Musavi1-Apr-07 8:50 
AnswerRe: tcp in C++? Pin
Mark Salsbery1-Apr-07 10:01
Mark Salsbery1-Apr-07 10:01 
GeneralRe: tcp in C++? Pin
mmavipc1-Apr-07 13:51
mmavipc1-Apr-07 13:51 
GeneralRe: tcp in C++? Pin
ThatsAlok1-Apr-07 23:01
ThatsAlok1-Apr-07 23:01 
GeneralRe: tcp in C++? Pin
Mark Salsbery2-Apr-07 6:18
Mark Salsbery2-Apr-07 6:18 
Questionoverriding SIGINT Pin
xface661-Apr-07 7:16
xface661-Apr-07 7:16 
QuestionCustomizing Edit Control Pin
Super Hornet1-Apr-07 6:55
Super Hornet1-Apr-07 6:55 
AnswerRe: Customizing Edit Control Pin
Hamed Musavi1-Apr-07 8:46
Hamed Musavi1-Apr-07 8:46 
AnswerRe: Customizing Edit Control Pin
ThatsAlok1-Apr-07 23:01
ThatsAlok1-Apr-07 23:01 
Questionpwd command Pin
Arif Liminto1-Apr-07 5:00
professionalArif Liminto1-Apr-07 5:00 
AnswerRe: pwd command Pin
CPallini1-Apr-07 6:09
mveCPallini1-Apr-07 6:09 
GeneralRe: pwd command Pin
Eytukan1-Apr-07 6:14
Eytukan1-Apr-07 6:14 
GeneralRe: pwd command Pin
CPallini1-Apr-07 7:33
mveCPallini1-Apr-07 7:33 
GeneralRe: pwd command Pin
Eytukan1-Apr-07 19:56
Eytukan1-Apr-07 19: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.