Click here to Skip to main content
16,010,268 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem changing styles in CListView Pin
ijprest1-Aug-02 14:45
ijprest1-Aug-02 14:45 
GeneralRe: Problem changing styles in CListView Pin
ijprest2-Aug-02 20:07
ijprest2-Aug-02 20:07 
GeneralAfxGetMainWnd while creating CMainFrame Pin
Miguel Lopes31-Jul-02 14:07
Miguel Lopes31-Jul-02 14:07 
GeneralRe: AfxGetMainWnd while creating CMainFrame Pin
PJ Arends31-Jul-02 14:48
professionalPJ Arends31-Jul-02 14:48 
GeneralRe: AfxGetMainWnd while creating CMainFrame Pin
Miguel Lopes1-Aug-02 3:28
Miguel Lopes1-Aug-02 3:28 
GeneralRe: AfxGetMainWnd while creating CMainFrame Pin
PJ Arends1-Aug-02 7:07
professionalPJ Arends1-Aug-02 7:07 
GeneralRe: AfxGetMainWnd while creating CMainFrame Pin
Miguel Lopes1-Aug-02 8:48
Miguel Lopes1-Aug-02 8:48 
GeneralRe: AfxGetMainWnd while creating CMainFrame Pin
PJ Arends1-Aug-02 9:14
professionalPJ Arends1-Aug-02 9:14 
Do not declare global variables in any header files. Declare them in one, and only one cpp file, and any cpp file that needs to use them imports it using the extern keyword

// In MainFrame.cpp
...
#include "MainFrm.h"

CMainFrame *g_MyGlobalMainFrame = NULL;
...

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
        return -1;

    g_MyGlobalMainFrame = this;
...

// In any other cpp file that needs access to g_MyGlobalMainFrame
#include "MainFrm.h"
extern CMainFrame *g_MyGlobalMainFrame

...




CPUA 0x5041

Sonork 100.11743 Chicken Little

"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies

Within you lies the power for good - Use it!
GeneralRe: AfxGetMainWnd while creating CMainFrame Pin
Miguel Lopes2-Aug-02 0:57
Miguel Lopes2-Aug-02 0:57 
Question'Notify'-> WS_NOTIFY?!? Pin
Selevercin31-Jul-02 14:03
Selevercin31-Jul-02 14:03 
AnswerRe: 'Notify'-> WS_NOTIFY?!? Pin
Marc Clifton31-Jul-02 14:29
mvaMarc Clifton31-Jul-02 14:29 
GeneralRe: 'Notify'-> WS_NOTIFY?!? Pin
Selevercin31-Jul-02 14:44
Selevercin31-Jul-02 14:44 
GeneralRe: 'Notify'-> WS_NOTIFY?!? Pin
Marc Clifton31-Jul-02 16:29
mvaMarc Clifton31-Jul-02 16:29 
AnswerRe: 'Notify'-> WS_NOTIFY?!? Pin
PJ Arends31-Jul-02 14:44
professionalPJ Arends31-Jul-02 14:44 
GeneralRe: 'Notify'-> WS_NOTIFY?!? Pin
Selevercin31-Jul-02 14:54
Selevercin31-Jul-02 14:54 
GeneralRe: 'Notify'-> WS_NOTIFY?!? Pin
PJ Arends31-Jul-02 15:09
professionalPJ Arends31-Jul-02 15:09 
GeneralBeginner's one: Minimizing wnd message... Pin
BlackSmith31-Jul-02 13:48
BlackSmith31-Jul-02 13:48 
GeneralRe: Beginner's one: Minimizing wnd message... Pin
PJ Arends31-Jul-02 14:39
professionalPJ Arends31-Jul-02 14:39 
GeneralRe: Beginner's one: Minimizing wnd message... Pin
JohnnyG31-Jul-02 15:16
JohnnyG31-Jul-02 15:16 
Questionmfc70.dll bug? Pin
Marc Clifton31-Jul-02 13:18
mvaMarc Clifton31-Jul-02 13:18 
General102 compiling errors in commdlg.h Pin
redeemer31-Jul-02 13:00
redeemer31-Jul-02 13:00 
GeneralRe: 102 compiling errors in commdlg.h Pin
Chris Losinger31-Jul-02 13:02
professionalChris Losinger31-Jul-02 13:02 
GeneralCalling AfxMessageBox from within CDocument Class Pin
adamUK31-Jul-02 12:34
adamUK31-Jul-02 12:34 
GeneralRe: Calling AfxMessageBox from within CDocument Class Pin
adamUK23-Aug-02 5:18
adamUK23-Aug-02 5:18 
GeneralProblem with InsertMenu with respect to Release vs. Debug compulation Pin
Eldon Zacek31-Jul-02 11:56
Eldon Zacek31-Jul-02 11: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.