Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - StripMnemonics not correct
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

StripMnemonics not correct

 Post Reply Post Reply
Author
Message
zitz View Drop Down
Senior Member
Senior Member


Joined: 05 October 2008
Status: Offline
Points: 112
Post Options Post Options   Thanks (0) Thanks(0)   Quote zitz Quote  Post ReplyReply Direct Link To This Post Topic: StripMnemonics not correct
    Posted: 27 May 2009 at 2:01am
I use Xtreme ToolkitPro v13.0.0, static

error in code:

void CXTPDrawHelpers::StripMnemonics(CString& strClear)
{
    for (int i = 0; i < strClear.GetLength(); i++)
    {
        if (strClear{i} == _T('&') && (i == strClear.GetLength() - 1 || strClear{i + 1} != _T('&')))
        {
            DELETE_S(strClear, i);
        }
    }
}


At toolbar button i want to see "Capture && string"
pButton->SetCapture( _T("Capture &&&& string") )
and i got "Capture &&& string" :(((
Back to Top
zitz View Drop Down
Senior Member
Senior Member


Joined: 05 October 2008
Status: Offline
Points: 112
Post Options Post Options   Thanks (0) Thanks(0)   Quote zitz Quote  Post ReplyReply Direct Link To This Post Posted: 27 May 2009 at 2:02am
How to fix?
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: 27 May 2009 at 2:36am
Hi,
 
Thanks, agree. please replace it to:
 
void CXTPDrawHelpers::StripMnemonics(CString& strClear)
{
 for (int i = 0; i < strClear.GetLength(); i++)
 {
  if (strClear == _T('&')) // Converts "&&" to "&" and "&&&&" to "&&"
  {
   DELETE_S(strClear, i);
  }
 }
}
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
zitz View Drop Down
Senior Member
Senior Member


Joined: 05 October 2008
Status: Offline
Points: 112
Post Options Post Options   Thanks (0) Thanks(0)   Quote zitz Quote  Post ReplyReply Direct Link To This Post Posted: 27 May 2009 at 4:27am
Thank You, Oleg!
Please comment: https://forum.codejock.com/forum_posts.asp?TID=14321
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.188 seconds.