Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - how to get value of CXTPControlEdit
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

how to get value of CXTPControlEdit

 Post Reply Post Reply
Author
Message
xxcln View Drop Down
Newbie
Newbie
Avatar

Joined: 05 June 2007
Location: China
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote xxcln Quote  Post ReplyReply Direct Link To This Post Topic: how to get value of CXTPControlEdit
    Posted: 25 June 2007 at 2:08am

I create a edit in a toolbar,how to get value of the edit.

Back to Top
xxcln View Drop Down
Newbie
Newbie
Avatar

Joined: 05 June 2007
Location: China
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote xxcln Quote  Post ReplyReply Direct Link To This Post Posted: 25 June 2007 at 6:59am

Let me describe detail:

//In OnCreateControl(LPCREATECONTROLSTRUCT lpCreateControl)
if (lpCreateControl->nID == ID_COUNTER_QUICKSEARCH)
 {
  CXTPControlEdit* pEdit = (CXTPControlEdit*) CXTPControlEdit::CreateObject();
  lpCreateControl->pControl = pEdit;
  return TRUE;
 }
 
//handle message
ON_XTP_EXECUTE(ID_COUNTER_QUICKSEARCH, OnCounterQuicksearch)
 
void CChildFrame::OnCounterQuicksearch(NMHDR* pNMHDR, LRESULT* pResult)
{
 // TODO: Add your command handler code here
 NMXTPCONTROL* tagNMCONTROL = (NMXTPCONTROL*)pNMHDR;
 CXTPControlComboBox* pEdit = (CXTPControlComboBox*)tagNMCONTROL->pControl;
 ASSERT(pEdit);
 ASSERT(pEdit->GetType() == xtpControlEdit);
 CString edit = ((CXTPControlEdit*)pEdit)->GetEditText();
 AfxMessageBox(edit);
}
add follow code then edit can't display in the toolbar
Back to Top
xxcln View Drop Down
Newbie
Newbie
Avatar

Joined: 05 June 2007
Location: China
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote xxcln Quote  Post ReplyReply Direct Link To This Post Posted: 25 June 2007 at 7:13am

edit display but unavailable

Back to Top
xxcln View Drop Down
Newbie
Newbie
Avatar

Joined: 05 June 2007
Location: China
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote xxcln Quote  Post ReplyReply Direct Link To This Post Posted: 25 June 2007 at 2:54pm
ON_XTP_EXECUTE not launch
Back to Top
xxcln View Drop Down
Newbie
Newbie
Avatar

Joined: 05 June 2007
Location: China
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote xxcln Quote  Post ReplyReply Direct Link To This Post Posted: 26 June 2007 at 12:44am

Does the message ON_XTP_EXECUTE can't handle in ChildFrame?

Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 26 June 2007 at 12:57am
Hello,
Yes, you can, Edit is disabled because you don't have update handler for it.
Add

 ON_UPDATE_COMMAND_UI(ID_COUNTER_QUICKSEARCH, OnUpdateQuickSearch)
void CChildFrame::OnUpdateQuickSearch(CCmdUI *pCmdUI)
{
 pCmdUI->Enable();
}
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
xxcln View Drop Down
Newbie
Newbie
Avatar

Joined: 05 June 2007
Location: China
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote xxcln Quote  Post ReplyReply Direct Link To This Post Posted: 26 June 2007 at 3:09am
thank you, but ON_XTP_EXECUTE still not launch.whether the version's problem(my version 9.6),or when create toolbar in childframe need something else.
Back to Top
Barto View Drop Down
Groupie
Groupie


Joined: 27 February 2005
Location: Germany
Status: Offline
Points: 60
Post Options Post Options   Thanks (0) Thanks(0)   Quote Barto Quote  Post ReplyReply Direct Link To This Post Posted: 26 June 2007 at 4:11am
make sure to derive your frame from CXTPFrameWndBase<CMDIChildWnd>
and not from CMDIChildWnd, otherwise a lot of XTP messages don't get processed correctly
Back to Top
xxcln View Drop Down
Newbie
Newbie
Avatar

Joined: 05 June 2007
Location: China
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote xxcln Quote  Post ReplyReply Direct Link To This Post Posted: 26 June 2007 at 4:36am

my god ,solve eventually,thanks barto oleg

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.031 seconds.