Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - ReportItemControl 'SetCapture' problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ReportItemControl 'SetCapture' problem

 Post Reply Post Reply
Author
Message
yayo View Drop Down
Groupie
Groupie
Avatar

Joined: 22 December 2006
Location: Korea, South
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote yayo Quote  Post ReplyReply Direct Link To This Post Topic: ReportItemControl 'SetCapture' problem
    Posted: 22 November 2009 at 8:32pm
I found some faults in extreme toolkit codes.
I want for you to modify a message function as follows.
 
void CReportItemControlsDlg::OnItemButtonClick(NMHDR * pNotifyStruct, LRESULT*)
{
 XTP_NM_REPORTITEMCONTROL* pItemNotify = (XTP_NM_REPORTITEMCONTROL*) pNotifyStruct;
 if(!(pItemNotify->pRow && pItemNotify->pItem && pItemNotify->pItemControl))
  return;
 
 CTestDlg dlg;
 dlg.DoModal(); // CTestDlg doesn't work due to receiving a messeage in ReleaseCapture(). please refer to a modified code that I attached.
 
...
 
}
 
 
I recommand as follows:
 
BOOL CXTPReportRecordItem::OnLButtonUp(XTP_REPORTRECORDITEM_CLICKARGS* pClickArgs)
{
 if (m_pItemControlHookWnd && m_pFocusedItemControl)
 {
  pClickArgs->pControl->ScreenToClient(&pClickArgs->ptClient);
//   yayo write :
 // destroy item control window
  ReleaseCapture();

  m_pFocusedItemControl->OnLButtonUp(pClickArgs); // XTP_NM_REPORT_ITEMBUTTONCLICK 
  pClickArgs->pControl->RedrawControl();
  

// yayo
  // destroy item control window
  //ReleaseCapture();
  m_pItemControlHookWnd->DestroyWindow();
  delete m_pItemControlHookWnd;
  m_pItemControlHookWnd = NULL;
  return TRUE;
 }
 
hi
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 22 November 2009 at 11:14pm
Can't confirm - try this:

void CReportItemControlsDlg::OnItemButtonClick(NMHDR * pNotifyStruct, LRESULT*) {

XTP_NM_REPORTITEMCONTROL* pItemNotify = (XTP_NM_REPORTITEMCONTROL*) pNotifyStruct;

if (!(pItemNotify->pRow && pItemNotify->pItem && pItemNotify->pItemControl)) return;

if (AfxMessageBox(_T("AfxMessageBox"), MB_OKCANCEL) != IDOK) return;

switch(pItemNotify->pItemControl->GetIndex()) ........................
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.