Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPEdit in command bar displays unicode box
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPEdit in command bar displays unicode box

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


Joined: 20 August 2012
Location: Shawnee, KS
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote bbeacom Quote  Post ReplyReply Direct Link To This Post Topic: CXTPEdit in command bar displays unicode box
    Posted: 20 August 2012 at 1:30pm
Env: VS 2010 (2008 compiler), Windows 7 64 bit US English, CodeJock version 12.0.2; Unicode build of the application

NOTE: This behavior occurs when using  the UNICODE build ... it does NOT occur when using CXTEdit control instead of the CXTPEdit control, but CXTEdit does not appear to be available for command bars.

-----
UPDATE: 27-Aug-2012

The application uses CXTEdit in several places, which is derived directly from CEdit. This derivation does not have the paste-of-unicode-displays-unicode-box problem. When I change those places to use CXTPEdit (notice the "P" in teh class name, its the edit control used on command bars, can someone tell me why?) it fails. When I use a debugger to force CXTPEdit to NOT use either rich edit control (ie, make hInstance of LoadLibrary false forcing use of CEdit), the problem goes away.

So...is there a way to tell the command bar on creation of a default edit control to ignore any installed instances of a rich edit control (for our [purposes, it is just an edit box to enter text to find, no rich edit features are required)? Optionally, is there an option missing that should be added when the rich edit control is added (eg, TM_MULTICODEPAGE - altho per MSDN documentation, this is the default, but that appears to not be the case at least that is my guess as to why the display problem)?
-----

We create a control bar having a label, an edit control and two buttons. The code to create the edit control on the command bar is:
CXTPToolbar pBar = GetCommandBars()->Add(_T("Find"), xtpBarTop);
...
CXTPControlEdit* pEdit = pBar->GetControls()->Add(xtpControlEdit, 57757);
pEdit->SetCaption(_T("Find"));
pEdit->SetTooltip(_T("Find"));
pEdit->ShowLabel(FALSE);
pEdit->SetPrompt(_T"Find"));

When the user attempts to paste supplementary characters, the "unicode box" character is displayed. However, getting the text from the control yields the correct data. This behavior does not occur a CXTPEdit control used standalone like in a dialog box. I am not sure if it is creating and using a rich edit control behind the CXTPEdit control and that the default settings for that are not working or if the paste message is handled differently because it is on a control bar?

Is there a recommended workaround?

Also, does the CXTPEdit implementation handle the case when there is a limit on the size (ie SetLimitText has been called, eg 20) and a paste operation attempts to put a string which exceeds the length, but cutting it at the exact limit of 20 results in a malformed UTF-8/UTF-16 encoded string, to cut off more to be sure it is not malformed?

Thanks,
Bill

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