Discussion:
Runtime error at GetWindowInfo()
(too old to reply)
Andrew
2006-09-13 14:52:01 UTC
Permalink
Hi,

I'm writing a MFC doc/view application and try to retrieve the window frame
info. So I called GetWindowInfo() within the view object. The compilation
was ok but I got exception at runtime. Here is my code:

void CMyAppView::OnInitialUpdate( )
{
PWINDOWINFO p;
::memset (&p, 0, sizeof (p) );
GetParentFrame()->GetWindowInfo(p);
}

And the runtime exception occurs at afxwin4.inl, where CWnd::GetWindowInfo()
is defined:

AFX_INLINE BOOL CWnd::GetWindowInfo(PWINDOWINFO pwi) const
{ ASSERT(::IsWindow(m_hWnd)); return ::GetWindowInfo(m_hWnd, pwi); }

I really can't figure out what went wrong. Please HELP!

Thank you.

Andrew
k***@gmail.com
2006-09-13 15:27:33 UTC
Permalink
looks like memory is not allocated try,

WINDOWINFO p
GetParentFrame()->GetWindowInfo(&p)

/Kiran
Post by Andrew
Hi,
I'm writing a MFC doc/view application and try to retrieve the window frame
info. So I called GetWindowInfo() within the view object. The compilation
void CMyAppView::OnInitialUpdate( )
{
PWINDOWINFO p;
::memset (&p, 0, sizeof (p) );
GetParentFrame()->GetWindowInfo(p);
}
And the runtime exception occurs at afxwin4.inl, where CWnd::GetWindowInfo()
AFX_INLINE BOOL CWnd::GetWindowInfo(PWINDOWINFO pwi) const
{ ASSERT(::IsWindow(m_hWnd)); return ::GetWindowInfo(m_hWnd, pwi); }
I really can't figure out what went wrong. Please HELP!
Thank you.
Andrew
Andrew
2006-09-14 04:31:02 UTC
Permalink
Sorry, it doesn't work. The same runtime error still appears... Any further
suggestions?

Andrew
Post by k***@gmail.com
looks like memory is not allocated try,
WINDOWINFO p
GetParentFrame()->GetWindowInfo(&p)
/Kiran
Post by Andrew
Hi,
I'm writing a MFC doc/view application and try to retrieve the window frame
info. So I called GetWindowInfo() within the view object. The compilation
void CMyAppView::OnInitialUpdate( )
{
PWINDOWINFO p;
::memset (&p, 0, sizeof (p) );
GetParentFrame()->GetWindowInfo(p);
}
And the runtime exception occurs at afxwin4.inl, where CWnd::GetWindowInfo()
AFX_INLINE BOOL CWnd::GetWindowInfo(PWINDOWINFO pwi) const
{ ASSERT(::IsWindow(m_hWnd)); return ::GetWindowInfo(m_hWnd, pwi); }
I really can't figure out what went wrong. Please HELP!
Thank you.
Andrew
Loading...