![]() |
DockPane Problem!!! |
Post Reply ![]() |
Author | |
wshmouse2003 ![]() Newbie ![]() Joined: 20 April 2008 Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() Posted: 20 April 2008 at 10:09am |
Hi, I use the Xtreme toolkit in my applacation. Now I have one problem long time.
In my applacation, I create two DcokPane,
In the first Pane(pMyList), I added my CMyListCtrl object (CMyListCtrl calss is a CListctrl derived class), other pane(pFormView) I attach my CMyFormView object which derived CFormView. And i create on thread func.
In my CMyFormView, I add one Data Members m_ImgTree, it is one CMyImgTree control object. CMyImgTree is a CTreeCtrl derived class.
In CMyListCtrl, I add one custom message with ON_REGISTERED_MESSAGE macros. In my thread func i use PostMessage func post my custom message to CMyListCtrl. it work well.
Now i want send data to CMyImgTree object, so i add custom message with ON_REGISTERED_MESSAGE macros in CMyFormView again. And In CMyListCtrl class custom message func I add PostMessage for sending data to CMyFormView, but it has one problem. It worked awfully.
There no any data in the pFormView and the pMyList. And the applacation halt, i must stop it in vs2008. But the CMyListCtrl object scrollbar was moved buttom, so it should have data which no appeared.
How solve the problem?
the code like this
void CapThreadFunc()
{ HRESULT hs; while ( (( hs = pcap_next_ex( (pcap_t*) adhandle, &header,(const unsigned char**)&pkt_dataSource ) ) >= 0)&&bRun ) { ::PostMessage(((CMyListCtrl*)(&((CMainFrame*)(AfxGetApp()->m_pMainWnd))->m_PacketInfoList))->m_hWnd,WM_GETDATAFROMTHREAD,0,0); } } LRESULT CMyListCtrl::OnGetDataFromTread(WPARAM wParam, LPARAM lParam)
{ MY FUNC CODE;
if(my codition)
{
CMainFrame* pMainFrame = (CMainFrame*)(AfxGetApp()->m_pMainWnd);
CXTPDockingPane* pImgInfoPane = pMainFrame->m_paneManager.FindPane(IDR_IMG_TREEPANE); CMyFormView* pImgInfoTree = (CMyFormView*)pImgInfoPane->GetChild(); ::PostMessage(pImgInfoTree->m_hWnd,WM_GETDATAFROMTHREADIMGTREE,0,0); }
LRESULT CMyFormView::OnGetDataFromTread( WPARAM wParam, LPARAM lParam )
{ my func code; return x;
} }
Thanks.
|
|
![]() |
|
Smucker ![]() Senior Member ![]() ![]() Joined: 02 February 2008 Status: Offline Points: 156 |
![]() ![]() ![]() ![]() ![]() |
It sounds like flooding your message queue (posting messages faster than they can be processed).
As long as the list control and form view are handled by the same GUI thread, you've already transitioned to it by the PostMessage from your work thread, so you can use SendMessage or even simpler call a public method in the form view. |
|
Product: Xtreme Toolkit Pro version 13.2 (Unicode, static build)
Platform: Windows 200x/XP/Vista/Win7 (32/64 bit) Language: Visual C++ 9.0 (Studio 2008) |
|
![]() |
|
wshmouse2003 ![]() Newbie ![]() Joined: 20 April 2008 Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() |
Thank you very much.
I modify my code, and the CMylistCtrl work well, but the formview do not work, and i cannt trace it. Why?
|
|
![]() |
|
wshmouse2003 ![]() Newbie ![]() Joined: 20 April 2008 Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() |
how can i get the formview which is already attach pane?
|
|
![]() |
|
Smucker ![]() Senior Member ![]() ![]() Joined: 02 February 2008 Status: Offline Points: 156 |
![]() ![]() ![]() ![]() ![]() |
I'm glad I was able to help, but I'm afraid I don't have enough info to help with your form view.
|
|
Product: Xtreme Toolkit Pro version 13.2 (Unicode, static build)
Platform: Windows 200x/XP/Vista/Win7 (32/64 bit) Language: Visual C++ 9.0 (Studio 2008) |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |