Click here to Skip to main content
15,912,665 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How do I use the keyword refof C# in C++? Pin
Joe Woodbury16-May-08 19:26
professionalJoe Woodbury16-May-08 19:26 
GeneralRe: How do I use the keyword refof C# in C++? Pin
Hamid_RT16-May-08 19:27
Hamid_RT16-May-08 19:27 
QuestionHow do I send a WM_PAINT message Pin
Kwanalouie16-May-08 12:28
Kwanalouie16-May-08 12:28 
AnswerRe: How do I send a WM_PAINT message Pin
Nelek16-May-08 15:16
protectorNelek16-May-08 15:16 
GeneralRe: How do I send a WM_PAINT message Pin
Kwanalouie16-May-08 16:23
Kwanalouie16-May-08 16:23 
QuestionRe: How do I send a WM_PAINT message Pin
Nelek16-May-08 23:59
protectorNelek16-May-08 23:59 
AnswerRe: How do I send a WM_PAINT message Pin
akira3217-May-08 2:22
akira3217-May-08 2:22 
AnswerRe: How do I send a WM_PAINT message Pin
Kwanalouie17-May-08 3:45
Kwanalouie17-May-08 3:45 
Here's the more general question I have, which will answer my WM_PAINT post.

I'm using Visual C++ 6.0 MFC in an SDI application.
From another class (defined in separate .h & .cpp files) I would like to call a function called "OnViewShowTest" that is defined in the main program - MainFrm.cpp In my MainFrm.cpp, this OnViewShowTest is called when a Menu Item is clicked. I don't know how to call this same function from a function in another class to do the same thing that happens win the menu item is clicked because I don't understand what object it is associated with. Here's the code snippets

In a header file called MainFrm.h the following snippet is defined:

// MainFrm.h
class CMainFrame : public CFrameWnd
{

protected: // create from serialization only
CMainFrame();
DECLARE_DYNCREATE(CMainFrame)
// Implementation
public:
virtual ~CMainFrame();
afx_msg void OnViewShowwall();

protected: // control bar embedded members
CStatusBar m_wndStatusBar;
CToolBar m_wndToolBar;

// Generated message map functions
protected:
//{{AFX_MSG(CMainFrame)
afx_msg void OnViewShowTest();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};

// Now the code for OnViewShowTest is in MainFrm.cpp shown as:

void CMainFrame::OnViewShowTest()
{
// TODO: Add your command handler code here
}

Now I have a function that gets called in another class (actually its in the doc class of my program). That function snippet is:

void CTestProgramDoc::OnNewjobmenu()
{
// I would like to call the OnViewShowTest() from here but I
//don't know how to set things up to do that
}
GeneralRe: How do I send a WM_PAINT message Pin
Nelek17-May-08 8:16
protectorNelek17-May-08 8:16 
GeneralRe: How do I send a WM_PAINT message Pin
Kwanalouie18-May-08 1:35
Kwanalouie18-May-08 1:35 
GeneralRe: How do I send a WM_PAINT message Pin
Nelek21-May-08 8:23
protectorNelek21-May-08 8:23 
QuestionSOLVED - Passing CObject to OnUpdate - compiler error C2039 [modified] Pin
Vaclav_16-May-08 6:12
Vaclav_16-May-08 6:12 
AnswerRe: Passing CObject to OnUpdate - compiler error C2039 Pin
mid=574116-May-08 6:49
mid=574116-May-08 6:49 
GeneralRe: Passing CObject to OnUpdate - compiler error C2039 Pin
Kelly Herald16-May-08 6:52
Kelly Herald16-May-08 6:52 
AnswerRe: Passing CObject to OnUpdate - compiler error C2039 Pin
Kelly Herald16-May-08 6:50
Kelly Herald16-May-08 6:50 
GeneralRe: Passing CObject to OnUpdate - compiler error C2039 Pin
Vaclav_16-May-08 7:01
Vaclav_16-May-08 7:01 
QuestionDo any body know the encoding formate of .rc file in VS 2005? Pin
sumit.durg16-May-08 5:19
sumit.durg16-May-08 5:19 
AnswerRe: Do any body know the encoding formate of .rc file in VS 2005? Pin
mid=574116-May-08 6:46
mid=574116-May-08 6:46 
QuestionError adding a string to a DropList Pin
piul16-May-08 5:13
piul16-May-08 5:13 
AnswerRe: Error adding a string to a DropList Pin
toxcct16-May-08 5:19
toxcct16-May-08 5:19 
GeneralRe: Error adding a string to a DropList Pin
piul16-May-08 5:25
piul16-May-08 5:25 
QuestionRe: Error adding a string to a DropList Pin
CPallini16-May-08 5:24
mveCPallini16-May-08 5:24 
AnswerRe: Error adding a string to a DropList Pin
piul16-May-08 5:26
piul16-May-08 5:26 
GeneralRe: Error adding a string to a DropList Pin
CPallini16-May-08 5:29
mveCPallini16-May-08 5:29 
QuestionRe: Error adding a string to a DropList Pin
piul16-May-08 5:40
piul16-May-08 5:40 

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.