Click here to Skip to main content
16,011,680 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: skip droping the combobox Pin
Anonymous7-Nov-02 3:06
Anonymous7-Nov-02 3:06 
GeneralRe: skip droping the combobox Pin
alex.barylski7-Nov-02 9:07
alex.barylski7-Nov-02 9:07 
Generalhelp...... Pin
MFC is the Best6-Nov-02 11:27
MFC is the Best6-Nov-02 11:27 
GeneralRe: help...... Pin
Christian Graus6-Nov-02 11:50
protectorChristian Graus6-Nov-02 11:50 
GeneralRe: help...... Pin
MFC is the Best7-Nov-02 5:28
MFC is the Best7-Nov-02 5:28 
GeneralRe: help...... Pin
Christian Graus7-Nov-02 10:06
protectorChristian Graus7-Nov-02 10:06 
GeneralRe: help...... Pin
MFC is the Best9-Nov-02 5:33
MFC is the Best9-Nov-02 5:33 
GeneralFoward Declare Pin
bhutt6-Nov-02 11:05
bhutt6-Nov-02 11:05 
Discription: MFC application using Foward Declare.

What the program is Suppose to do:

Pressing the left mouse button calls m_CGoHereFirst.Funct1();
located in the class CGoHereFirst().
It Prints: "1st: Var = 5", which works fine.
It then calls m_CGoHereSecond->Funct2(); located in CGoHereSecond().
It is suppose to print "2nd: Var = 5", however I get the Error message;
"This program has performed an illegal operation and will be shut down"

Why is the second print message causing an Error?
How do I fix the problem?


Important header and cpp functions listed below:

HEADER FILE INFO:
CGoHereFirst.h:

class CGoHereSecond; // Part of 2nd Foward Declare
class CGoHereFirst : public CWnd
{
// Implementation
public:
CGoHereSecond *m_CGoHereSecond; // Part of 2nd Foward Declare
int Var;
void Funct1();
virtual ~CGoHereFirst();
};


CGoHereSecond.h: Forward Declare

class CGoHereFirst; // Part of 1st Foward Declare
class CGoHereSecond : public CWnd
{
// Implementation
public:
CGoHereFirst *m_CGoHereFirst; // Part of 1st Foward Declare
void Funct2();
virtual ~CGoHereFirst();
};

Foward_Declare.h:

// Implementation
public:
CGoHereFirst m_CGoHereFirst;


MEMBER FUNCTIONS:

void CForward_DeclareView::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default

m_CGoHereFirst.Funct1();

CView::OnLButtonDown(nFlags, point);
}


#include "GoHereSecond.h" // Part of 2nd Foward Declare
void CGoHereFirst::Funct1()
{
Var = 5;

CString a;
a.Format("1st: Var = %d", Var);
AfxMessageBox(a);

m_CGoHereSecond->Funct2();
}

#include "GoHereFirst.h" // Part of 1st Foward Declare
void CGoHereSecond::Funct2()
{

CString b;
b.Format("2nd: Var = %d", m_CGoHereFirst->Var);
AfxMessageBox(b);
}

GeneralStrange exception behaviour Pin
Boris Russel6-Nov-02 10:34
Boris Russel6-Nov-02 10:34 
GeneralRe: Strange exception behaviour Pin
Boris Russel6-Nov-02 10:39
Boris Russel6-Nov-02 10:39 
Generalis there any api that tell the name of currently Pin
imran_rafique6-Nov-02 10:18
imran_rafique6-Nov-02 10:18 
GeneralRe: is there any api that tell the name of currently Pin
Gary Kirkham6-Nov-02 10:38
Gary Kirkham6-Nov-02 10:38 
Questionhow to process active window hwnd ? Pin
imran_rafique6-Nov-02 10:04
imran_rafique6-Nov-02 10:04 
AnswerRe: how to process active window hwnd ? Pin
Christian Graus6-Nov-02 10:50
protectorChristian Graus6-Nov-02 10:50 
GeneralCPropertyPage doesn't get the focus! Pin
Daniel Strigl6-Nov-02 10:04
Daniel Strigl6-Nov-02 10:04 
GeneralRe: CPropertyPage doesn't get the focus! Pin
Anonymous6-Nov-02 13:20
Anonymous6-Nov-02 13:20 
GeneralRe: CPropertyPage doesn't get the focus! Pin
Daniel Strigl6-Nov-02 20:18
Daniel Strigl6-Nov-02 20:18 
Generalstrchr() performance versus for loop Pin
alex.barylski6-Nov-02 9:54
alex.barylski6-Nov-02 9:54 
GeneralRe: strchr() performance versus for loop Pin
Tim Smith6-Nov-02 10:09
Tim Smith6-Nov-02 10:09 
GeneralRe: strchr() performance versus for loop Pin
Daniel Turini6-Nov-02 10:06
Daniel Turini6-Nov-02 10:06 
GeneralRe: strchr() performance versus for loop Pin
Paul M Watt6-Nov-02 10:07
mentorPaul M Watt6-Nov-02 10:07 
GeneralRe: strchr() performance versus for loop Pin
Tim Smith6-Nov-02 10:44
Tim Smith6-Nov-02 10:44 
GeneralRe: strchr() performance versus for loop Pin
alex.barylski6-Nov-02 12:02
alex.barylski6-Nov-02 12:02 
GeneralRe: strchr() performance versus for loop Pin
alex.barylski6-Nov-02 11:52
alex.barylski6-Nov-02 11:52 
GeneralRe: strchr() performance versus for loop Pin
Tim Smith6-Nov-02 12:24
Tim Smith6-Nov-02 12:24 

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.