![]() |
How to disable scripts when using CXTHtmlView |
Post Reply
|
| Author | |
fabien7474
Newbie
Joined: 09 December 2006 Status: Offline Points: 4 |
Post Options
Thanks(0)
Quote Reply
Topic: How to disable scripts when using CXTHtmlViewPosted: 09 December 2006 at 5:14am |
|
Hi,
I am using the CXTHtmlView class in our MFC document/view application in order to display HTML pages in a WebBrowser style. Nevertheless, we would like sometimes to disable scripts (for instance java-scripts) when rendering the HTML page (for security reasons). I didn''t find any method/code that provides this functionnality.
Do you know if it is possible to do it using CXTHtmlView class. If not, what do you suggest in order to do it.
Thank you very very much, Fabien. |
|
![]() |
|
Simon HB9DRV
Senior Member
Joined: 07 July 2005 Location: Switzerland Status: Offline Points: 458 |
Post Options
Thanks(0)
Quote Reply
Posted: 09 December 2006 at 5:40am |
|
I would like to be able to disable Flash on various sites, would also like any pointers.
|
|
|
Simon HB9DRV
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 09 December 2006 at 10:35am |
|
Hi,
Check in msdn:
DISPID_AMBIENT_DLCONTROL and DLCTL_NO_SCRIPTS.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
fabien7474
Newbie
Joined: 09 December 2006 Status: Offline Points: 4 |
Post Options
Thanks(0)
Quote Reply
Posted: 09 December 2006 at 1:25pm |
|
Hi Oleg.
Thank you very much!! Anyway, I have been searching for DISPID_AMBIENT_DLCONTROL and DLCTL_NO_SCRIPTS but I didn't find any relevant C++ code, using these properties. Do you know how to use it? Do I need to use PutProperty() from CHtmlView? Do you have a very simple sample code? Thank you soooo much for your help... Fabien |
|
![]() |
|
fabien7474
Newbie
Joined: 09 December 2006 Status: Offline Points: 4 |
Post Options
Thanks(0)
Quote Reply
Posted: 09 December 2006 at 5:53pm |
|
Okay Guys!!
I spent my day on it but I finally figure out how to do it: BOOL CMyHtmlView::OnAmbientProperty(COleControlSite* pSite, DISPID dispid, VARIANT* pvar) { if (dispid == DISPID_AMBIENT_DLCONTROL) { pvar->vt = VT_I4; pvar->lVal = DLCTL_NO_SCRIPTS | DLCTL_NO_JAVA | DLCTL_NO_RUNACTIVEXCTLS | DLCTL_NO_DLACTIVEXCTLS; return true; } return HtmlView::OnAmbientProperty } Thanks, Fabien. |
|
![]() |
|
Simon HB9DRV
Senior Member
Joined: 07 July 2005 Location: Switzerland Status: Offline Points: 458 |
Post Options
Thanks(0)
Quote Reply
Posted: 10 December 2006 at 3:36am |
Excellent - weel done lad! |
|
|
Simon HB9DRV
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |