CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Join Date
    May 2002
    Posts
    1,798

    How to get MFC CHtmlView to run HTML5 and CSS3

    MFC CHtmlView is a beautiful and flexible interface for building desktop apps testing out *.html files locally. However, the current version only uses Internet Explorer which does not recognize HTML5. I would like to use CHtmlView to employ Chrome, or some other means to read the most recent markup language and scripts. I have searched the web and have only come up with somewhat expensive solutions like WebKit. There are also some arcane vsix (Visual Studio Extensions) out there, but I don't trust them as they are not upfront about costs. I have also tried .NET with the same result, only the Internet Explorer is deployed. Surely there must be some way to get MFC CHtmlView to recognize HTML5 - but how? I look forward to your suggestions. Thanks.
    mpliam

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: How to get MFC CHtmlView to run HTML5 and CSS3

    Quote Originally Posted by Mike Pliam View Post
    MFC CHtmlView is a beautiful and flexible interface for building desktop apps testing out *.html files locally. However, the current version only uses Internet Explorer which does not recognize HTML5. I would like to use CHtmlView to employ Chrome, or some other means to read the most recent markup language and scripts. I have searched the web and have only come up with somewhat expensive solutions like WebKit. There are also some arcane vsix (Visual Studio Extensions) out there, but I don't trust them as they are not upfront about costs. I have also tried .NET with the same result, only the Internet Explorer is deployed. Surely there must be some way to get MFC CHtmlView to recognize HTML5 - but how? I look forward to your suggestions. Thanks.
    What version of IE? What OS are you testing on?

  3. #3
    Join Date
    May 2002
    Posts
    1,798

    Re: How to get MFC CHtmlView to run HTML5 and CSS3

    Internet Explorer 11 on Windows 7 (64-bit)
    mpliam

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: How to get MFC CHtmlView to run HTML5 and CSS3

    Pretty sure IE 11 supports html5. Have you tried opening html5 content directly in the ie 11 browser? Do you have the ie=edge setting in the html? Specifically:
    Code:
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    Last edited by Arjay; November 9th, 2016 at 10:37 PM.

  5. #5
    Join Date
    May 2002
    Posts
    1,798

    Re: How to get MFC CHtmlView to run HTML5 and CSS3

    I don't think so.

    See: http://www.html5report.com/topics/ht...some-html5.htm

    When I build a web browser app using C# and try to point it to a simple html5 / java script game (which runs just fine on my Win 7 Chrome browser), I receive the following message:
    Script Error

    An error has occurred in the script on this page

    Line 0
    Char: 0
    Error: Script error
    Code: 0
    URL: http://s7.addthis.com/js/250/addthis...t.js#pubid=ra-
    4da9ad3813b404b5

    Do you want to continue running scripts on this page?
    Answer Yes and the same error message reoccurs. Answer No and the local directory listing that contains the game appears int the main browser window. Clicking on that same game html5 brings up the Chrome browser (my default browser) which runs the game as it should be run.

    I have been very pleased with development on Win7 and don't wish to upgrade. Clearly, only Chrome on Win7 handles html5.

    I have tried to attach the simple game script for your own experimentation.
    Attached Files Attached Files
    mpliam

  6. #6
    Join Date
    May 2002
    Posts
    1,798

    Re: How to get MFC CHtmlView to run HTML5 and CSS3

    Upon further investigation I have determined that it is CHtmlView that is the problem, not the operating system and not Internet Explorer 11 (which at least on Win7 doesnt support html5 among other modern scripts). I was surprised to find that Chrome runs the sprite-animation even on Win2K. I wonder if there is something in the CHtmlView code that sets the browser to Internet Explorer rather than to Chrome. Question really is, is there any way to change CHtmlView's default browser? MS documentation on .NET WebBrowser indicates that the control is "hosted by Internet Explorer". I'm not sure what that means exactly, but it doesn't sound good if one wanted to use a more modern browser.
    Last edited by Mike Pliam; November 11th, 2016 at 01:54 AM.
    mpliam

  7. #7
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: How to get MFC CHtmlView to run HTML5 and CSS3


  8. #8
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: How to get MFC CHtmlView to run HTML5 and CSS3

    Quote Originally Posted by Mike Pliam View Post
    I'm not sure what that means exactly, but it doesn't sound good if one wanted to use a more modern browser.
    I'm not sure what exactly you're not sure of, but it sounds perfectly natural when some vendor's development platform forces you to stick with the vendor's environment. This is what they call investment protection. You step aside, you're on your own. Why would MS feel like being obliged to do a favor to Google or anybody else?

    In your case it's not like CHtmlView is sitting on an abstract web engine, letting you painlessly juggle with engines underneath. Just think for a moment, it would require the engines to provide a sort of uniformed API to dock the app level. Now can I ask you whether you sure that FF, Chrome, Safari and IE have anything common in that aspect? Why would they do?
    Last edited by Igor Vartanov; November 14th, 2016 at 03:57 AM.
    Best regards,
    Igor

  9. #9
    Join Date
    May 2002
    Posts
    1,798

    Re: How to get MFC CHtmlView to run HTML5 and CSS3

    Good point Igor. Nevertheless, there is some demand in the C++ community to be able to program a Chrome-like browser using Visual Studio. After wasting a significant amount of time researching this, thanks to Arjay, I discovered Cef which purports to facilitate such a project. I have been able to get Cef to work in C# but my C++ 64-bit efforts have been fraught with frustration. The following post gives details on exactly how to accomplish the latter.

    Building the 64-bit version of Chromium Embedded Framework on Windows
    http://mariusbancila.ro/blog/2016/05...comment-386144

    In all my years of cookbook programming, I have never encountered as complex and convoluted set of instructions as those provided in the above reference. At this point, I'm ready to abandon the idea and move on to other projects.
    mpliam

  10. #10
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,825

    Re: How to get MFC CHtmlView to run HTML5 and CSS3

    In all my years of cookbook programming, I have never encountered as complex and convoluted set of instructions as those provided in the above reference. At this point, I'm ready to abandon the idea and move on to other projects.
    To paraphrase,

    They cannot be serious!
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  11. #11
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: How to get MFC CHtmlView to run HTML5 and CSS3

    I happen to know the author. If you find these instructions confusing, imagine how it was for him to try to put it into words?

  12. #12
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,825

    Re: How to get MFC CHtmlView to run HTML5 and CSS3

    Quote Originally Posted by Arjay View Post
    I happen to know the author. If you find these instructions confusing, imagine how it was for him to try to put it into words?
    The stuff of nightmares!
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  13. #13
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: How to get MFC CHtmlView to run HTML5 and CSS3

    Quote Originally Posted by Mike Pliam View Post
    Good point Igor. Nevertheless, there is some demand in the C++ community to be able to program a Chrome-like browser using Visual Studio.
    With the demand you take a step aside. And as I said, you're on your own. As I understood you didn't like the result. The fact is that framework products like MFC accumulate a huge effort of high quality engineers. The effort that finally makes the ugly awkward complex things look easy and slick. But whatever the community demand were, big corporate things always remain corporate-centric. And community is to either live with that or put the same huge effort of high quality engineers into open source to achieve a comparable result of marrying an ugly awkward complex beast to a beauty.
    Last edited by Igor Vartanov; November 14th, 2016 at 04:13 PM.
    Best regards,
    Igor

  14. #14
    Join Date
    May 2002
    Posts
    1,798

    Re: How to get MFC CHtmlView to run HTML5 and CSS3

    Perhaps if someone could help me with the final step that I have alluded to I might make a beauty of the beast.
    Building the 64-bit version of Chromium Embedded Framework on Windows
    http://mariusbancila.ro/blog/2016/05...comment-386144
    mpliam

  15. #15
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: How to get MFC CHtmlView to run HTML5 and CSS3

    What version of Visual Studio are you using?

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured