Print Page | Close Window

StripMnemonics not correct

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=14393
Printed Date: 01 October 2024 at 8:20pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: StripMnemonics not correct
Posted By: zitz
Subject: StripMnemonics not correct
Date 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" :(((



Replies:
Posted By: zitz
Date Posted: 27 May 2009 at 2:02am
How to fix?


Posted By: Oleg
Date 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


Posted By: zitz
Date Posted: 27 May 2009 at 4:27am
Thank You, Oleg!
Please comment: https://forum.codejock.com/forum_posts.asp?TID=14321



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