Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - DockPane Problem!!!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

DockPane Problem!!!

 Post Reply Post Reply
Author
Message
wshmouse2003 View Drop Down
Newbie
Newbie


Joined: 20 April 2008
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote wshmouse2003 Quote  Post ReplyReply Direct Link To This Post Topic: DockPane Problem!!!
    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.
 
 
 
 
Back to Top
Smucker View Drop Down
Senior Member
Senior Member
Avatar

Joined: 02 February 2008
Status: Offline
Points: 156
Post Options Post Options   Thanks (0) Thanks(0)   Quote Smucker Quote  Post ReplyReply Direct Link To This Post 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)

Back to Top
wshmouse2003 View Drop Down
Newbie
Newbie


Joined: 20 April 2008
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote wshmouse2003 Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
wshmouse2003 View Drop Down
Newbie
Newbie


Joined: 20 April 2008
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote wshmouse2003 Quote  Post ReplyReply Direct Link To This Post Posted: 20 April 2008 at 11:21pm
how can i get the formview which is already attach pane?
Back to Top
Smucker View Drop Down
Senior Member
Senior Member
Avatar

Joined: 02 February 2008
Status: Offline
Points: 156
Post Options Post Options   Thanks (0) Thanks(0)   Quote Smucker Quote  Post ReplyReply Direct Link To This Post 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)

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