what could be the reason?
is there another possibility to get the mouse clicks?
bye and thank you mario
Matt
"Mario Vogel" <m.v...@ringwald.de> wrote in message
news:3A24FCBA...@ringwald.de...
my CStatic derived control is dynamically created without the ressource editor.
it has also a CFrameWnd as parent.
I think my problem is, that the control is not a child of a CDialog?
mario
Matt Slaughter wrote:
--
Dipl. Inf. Mario Vogel
Software-Entwicklung
Ringwald Mikroelektronik GmbH
Elberfelder Str. 18
10555 Berlin
-----------------------------
Tel.: ++49 (30) 390 479 24
Fax: ++49 (30) 390 479 29
E-Mail: m.v...@ringwald.de
Web: http://www.ringwald.de
Matt
"Mario Vogel" <m.v...@ringwald.de> wrote in message
news:3A252F49...@ringwald.de...
StaticInfo.h
--------------
class CStaticInfo : public CStatic
{
...
protected:
//{{AFX_MSG(CStaticInfo)
afx_msg void OnPaint();
//}}AFX_MSG
afx_msg void OnClicked();
...
}
StaticInfo.cpp
---------------
...
BEGIN_MESSAGE_MAP(CStaticInfo, CStatic)
//{{AFX_MSG_MAP(CStaticInfo)
ON_WM_PAINT()
//}}AFX_MSG_MAP
ON_CONTROL_REFLECT(STN_CLICKED, OnClicked)
END_MESSAGE_MAP()
...
void CStaticInfo::OnClicked()
{
AfxMessageBox("Text");
}
Declaration in CMainFrm.cpp
----------------------------
class CMainFrame : public CFrameWnd
{
...
protected:
CStaticInfo m_InfoRelaisA;
...
}
Calling function in CMainFrm.cpp
-----------------------------
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
...
m_InfoRelaisA.Create(NULL,WS_VISIBLE|WS_CHILD|SS_NOTIFY,CRect(10,100,50,200),
this, 50);
m_InfoRelaisA.ShowWindow(SW_SHOWNORMAL);
...
}
for ex.
m_InfoRelaisA.Create(NULL,WS_VISIBLE|WS_CHILD|SS_NOTIFY,CRect(10,100,50,200)
, &m_wndToolBar, 50);
and see if it works. I've done this with button controls and it works fine.
Matt
"Mario Vogel" <m.v...@ringwald.de> wrote in message
news:3A2535F8...@ringwald.de...
> ok, here are some parts of my programm;
> the CStatic object is visible (I overloaded
> the OnPaint() Message-Handler), but it doesn't
> catch the mouse-event:
>
>
> StaticInfo.h
> --------------
>
> class CStaticInfo : public CStatic
> {
> ...
>
> protected:
>
> file://{{AFX_MSG(CStaticInfo)
> afx_msg void OnPaint();
> file://}}AFX_MSG
> afx_msg void OnClicked();
>
> ...
> }
>
> StaticInfo.cpp
> ---------------
>
> ...
>
> BEGIN_MESSAGE_MAP(CStaticInfo, CStatic)
> file://{{AFX_MSG_MAP(CStaticInfo)
> ON_WM_PAINT()
> file://}}AFX_MSG_MAP
I tried to put it on a CDialogbar object (it is the
only graphicel object where I could place the control except for the main
window).
But all controls of the dialog bar are created by the ressource editor. if I
create the
static control dynamically with the dialog bar as parent window, it will not be
visible!
by mario
Matt Slaughter wrote:
--
Matt
"Mario Vogel" <m.v...@ringwald.de> wrote in message
news:3A260CE3...@ringwald.de...
"Mario Vogel" <m.v...@ringwald.de> wrote in message