Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Problems about Toolbar with Colorselector
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problems about Toolbar with Colorselector

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


Joined: 18 April 2005
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote youfly Quote  Post ReplyReply Direct Link To This Post Topic: Problems about Toolbar with Colorselector
    Posted: 18 April 2005 at 12:05pm

Excuse me,Sir
    I used a Toolbar with a Colorselector in my MFC application,just as the sample "TearOffPopups".But the colorselector didn't work well,maybe I lost some key codes.
    In my application, my View class was based on CView,but not CRichEditView,so when I complied it,some errs always appeared.

    void CMyView::OnUpdateSelectorText(CCmdUI* pCmd)
{
 CXTPCommandBar* pToolBar = (CXTPToolBar*)pCmd->m_pOther;
 if (pToolBar)
 { 
  CHARFORMAT& cfm = GetCharFormatSelection( ); 
  CXTPControlColorSelector* pSelector = (CXTPControlColorSelector*)pToolBar->GetControls()-> ; ;Ge tAt(pCmd->m_nIndex);
  pSelector->SetColor(cfm.dwEffects & CFE_AUTOCOLOR? -1: cfm.crTextColor);
 }
 pCmd->Enable(TRUE);
}

and CMyView was based on CView ,not CRichEditView,so the complier told me that
error C3861: 'GetCharFormatSelection': identifier not found, even with argument-dependent lookup

I had added this to my application
#include <afxrich.h>  // MFC rich edit classes
but it still didn't work .

Will anybody please help me? Thank you very much.
I'm waiting for your reply.....



Edited by youfly
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 19 April 2005 at 7:46am

If you don't use CRichEditView then you don't need GetCharFormatSelection,

 

use it like:

CXTPControlColorSelector* pSelector = (CXTPControlColorSelector*)pToolBar->GetControls()->Ge tAt(pCmd->m_nIndex);
  pSelector->SetColor(m_clrTextColor);
 

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
youfly View Drop Down
Newbie
Newbie


Joined: 18 April 2005
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote youfly Quote  Post ReplyReply Direct Link To This Post Posted: 21 April 2005 at 12:43pm
Thank you,oleg.I had done as what you said above.It worked quite well.
Thank you!!
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.157 seconds.