Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - StylerBrowser sample error!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

StylerBrowser sample error!

 Post Reply Post Reply
Author
Message
littleameng View Drop Down
Groupie
Groupie
Avatar

Joined: 22 June 2008
Location: China
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote littleameng Quote  Post ReplyReply Direct Link To This Post Topic: StylerBrowser sample error!
    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
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 09 July 2008 at 4:38am
What error ?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
littleameng View Drop Down
Groupie
Groupie
Avatar

Joined: 22 June 2008
Location: China
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote littleameng Quote  Post ReplyReply Direct Link To This Post Posted: 16 July 2008 at 10:50pm
the error message:
 
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 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
Back to Top
littleameng View Drop Down
Groupie
Groupie
Avatar

Joined: 22 June 2008
Location: China
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote littleameng Quote  Post ReplyReply Direct Link To This Post Posted: 17 July 2008 at 11:01pm
thank you for your answer!
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.030 seconds.