Print Page | Close Window

StylerBrowser sample error!

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=11356
Printed Date: 15 September 2025 at 8:36am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: StylerBrowser sample error!
Posted By: littleameng
Subject: StylerBrowser sample error!
Date Posted: 09 July 2008 at 2:17am
After build the stylerbrowser.exe I run it, then I put mouse on the source DockingPane , then I will get an error!
 
So I debug the stylerbrowser, and find that when the program run to SetTextFormat(psz) the error will happen.
 
CMainFrame::OnDockingPaneNotify(WPARAM wParam, LPARAM lParam)
  |
  |
  ___CSourceCtrl::Refresh(CHtmlView* pView, BOOL /*bForce*/)
            |
            |
            -----CSourceCtrl::SetTextFormat(psz)
 
 
how to solve the problem? thanks



Replies:
Posted By: Oleg
Date Posted: 09 July 2008 at 4:38am
What error ?

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: littleameng
Date Posted: 16 July 2008 at 10:50pm
the error message:
 


Posted By: Oleg
Date Posted: 17 July 2008 at 12:29pm
Hello,
 
Thanks, agree :-(
Sample's sources assumed length of ansi string is same as length of unicode. not for MBCS locale.
 
Please change code in CSourceCtrl::Refresh
 
replace
 int nLength = SysStringLen(bstrHTMLText);
  LPTSTR psz = new TCHAR[nLength + 1];
  lstrcpy(psz, OLE2T(bstrHTMLText));
  
  SetTextFormat(psz);
 
to
 
  CString str(bstrHTMLText);
  SetTextFormat((LPTSTR)(LPCTSTR)str);
 


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: littleameng
Date Posted: 17 July 2008 at 11:01pm
thank you for your answer!



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