Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. Using the InternetExplorer object in a Managed C++ application

Using the InternetExplorer object in a Managed C++ application

Scheduled Pinned Locked Moved Managed C++/CLI
csharpc++helpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chris Morrison
    wrote on last edited by
    #1

    Hi all, I am trying to use the InternetExplorer object to automate Internet Explorer from my Managed C++ application; The following is a snippit of C# code that compiles and runs. using SHDocVw; ............ ............ private SHDocVw.InternetExplorer m_IExplorer = null; .............. ............ .......... m_IExplorer = new SHDocVw.InternetExplorer(); However, when I convert it to Managed C++, thus; using namespace SHDocVw; ............ ............ private: SHDocVw::InternetExplorer m_IExplorer; .............. ............ .......... m_IExplorer = new SHDocVw::InternetExplorer(); I get the compile error C3153: 'SHDocVw::InternetExplorer' : you cannot create an instance of an interface Does anyone know what I am doing wrong? Regards, Chris

    R 1 Reply Last reply
    0
    • C Chris Morrison

      Hi all, I am trying to use the InternetExplorer object to automate Internet Explorer from my Managed C++ application; The following is a snippit of C# code that compiles and runs. using SHDocVw; ............ ............ private SHDocVw.InternetExplorer m_IExplorer = null; .............. ............ .......... m_IExplorer = new SHDocVw.InternetExplorer(); However, when I convert it to Managed C++, thus; using namespace SHDocVw; ............ ............ private: SHDocVw::InternetExplorer m_IExplorer; .............. ............ .......... m_IExplorer = new SHDocVw::InternetExplorer(); I get the compile error C3153: 'SHDocVw::InternetExplorer' : you cannot create an instance of an interface Does anyone know what I am doing wrong? Regards, Chris

      R Offline
      R Offline
      Roger Stewart
      wrote on last edited by
      #2

      Change Chris Morrison wrote: private: SHDocVw::InternetExplorer m_IExplorer; m_IExplorer = new SHDocVw::InternetExplorer(); To

      SHDocVw::InternetExplorerClass* ieForAutomation;
      ieForAutomation = new SHDocVw::InternetExplorerClass();

      Take a look at the VC.NET - Interop - Automate IE example found in the MSDN Visual C++ .NET 2003 Code Samples[^]. I bet this sample is doing some of the exact stuff you are trying to do! Roger Stewart "I Owe, I Owe, it's off to work I go..."

      C 1 Reply Last reply
      0
      • R Roger Stewart

        Change Chris Morrison wrote: private: SHDocVw::InternetExplorer m_IExplorer; m_IExplorer = new SHDocVw::InternetExplorer(); To

        SHDocVw::InternetExplorerClass* ieForAutomation;
        ieForAutomation = new SHDocVw::InternetExplorerClass();

        Take a look at the VC.NET - Interop - Automate IE example found in the MSDN Visual C++ .NET 2003 Code Samples[^]. I bet this sample is doing some of the exact stuff you are trying to do! Roger Stewart "I Owe, I Owe, it's off to work I go..."

        C Offline
        C Offline
        Chris Morrison
        wrote on last edited by
        #3

        Roger Stewart wrote: Change Chris Morrison wrote: private: SHDocVw::InternetExplorer m_IExplorer; m_IExplorer = new SHDocVw::InternetExplorer(); To SHDocVw::InternetExplorerClass* ieForAutomation; ieForAutomation = new SHDocVw::InternetExplorerClass(); Thanks Roger, I just cracked it by looking though the MSDN Library. Thank you for that link as well, that sample should come in very handy. Kind Regards, Chris

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups