Print Page | Close Window

DockPane Problem!!!

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=10309
Printed Date: 04 May 2024 at 8:23pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: DockPane Problem!!!
Posted By: wshmouse2003
Subject: DockPane Problem!!!
Date 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.
 
 
 
 



Replies:
Posted By: Smucker
Date Posted: 20 April 2008 at 3:15pm
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)



Posted By: wshmouse2003
Date Posted: 20 April 2008 at 10:49pm
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?


Posted By: wshmouse2003
Date Posted: 20 April 2008 at 11:21pm
how can i get the formview which is already attach pane?


Posted By: Smucker
Date Posted: 21 April 2008 at 8:23am
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)




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net