This is a discussion on POSTING SECOND TIME: members of object not shown. - Programmer ; Hi, I have #include #include #include "resource.h" class myframe : public CFrameWnd { private: CToolBar tb; public: myframe() { Create (0,"my window"); } int OnCreate(LPCREATESTRUCT l) { //CFrameWnd ::OnCreate(l); tb.Create(this, WS_CHILD|WS_VISIBLE|CBRS_TOP|CBRS_BORDER_LEFT|CBRS _BORDER_RIGHT|CBRS_BORDER_BOTTOM|CBRS_BORDER_TOP,A FX_IDW_TOOLBAR); tb.LoadToolBar(IDR_TOOLBAR1); return 0; } void fun(int id) ...
Hi,
I have
#include
#include
#include "resource.h"
class myframe : public CFrameWnd
{
private:
CToolBar tb;
public:
myframe()
{
Create (0,"my window");
}
int OnCreate(LPCREATESTRUCT l)
{
//CFrameWnd ::OnCreate(l);
tb.Create(this,
WS_CHILD|WS_VISIBLE|CBRS_TOP|CBRS_BORDER_LEFT|CBRS _BORDER_RIGHT|CBRS_BORDER_BOTTOM|CBRS_BORDER_TOP,A FX_IDW_TOOLBAR);
tb.LoadToolBar(IDR_TOOLBAR1);
return 0;
}
void fun(int id)
{
if (id==40001)
MessageBox ("1st button");
else if(id == 40002)
MessageBox ("2nd button");
}
DECLARE_MESSAGE_MAP()
};
BEGIN_MESSAGE_MAP(myframe,CFrameWnd)
ON_WM_CREATE()
ON_COMMAND_RANGE(40001, 40002, fun)
END_MESSAGE_MAP()
class myapp : public CWinApp
{
public:
int InitInstance()
{
myframe *p;
p=new myframe;
p->ShowWindow(1);
m_pMainWnd = p;
return 1;
}
};
myapp a;
well this a win32 application using MFC in shared DLL.
my CToolBar tb variable is private. so while coding in OnCreate
handler when i give period after tb. no members are shown
But I write them anyhow and run the program it works. If I get this
variable in the handler itself, i can see all the members of tb after
giving period while coding. So how to get member list displayed when
the object is a private variable.
thanks,
lee.
--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG