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
Chris Morrison
Posts
-
Using the InternetExplorer object in a Managed C++ application -
Using the InternetExplorer object in a Managed C++ applicationHi 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 -
XP styleI assmume that what you are asking is how to enable Windows XP Visual Styles for your application, so that you dialog window is drawn in the current theme. You will need to add a Common Controls Manifest to your application, this is a script written in XML that forces your application to use version 6.00 of the ComCtl32.dll to draw the controls and non-client areas of your windows. This manifest can be embedded in your exe file's resources, or you can place it in the same directory as your exe file and give it the same name as your exe file with .manifest appended to the end. For example, if your exe is called MyApp.exe then you would call you manifest file MyApp.exe.manifest. Click here[^] for further information. Hope this helps, Chris
-
Visual Studio AddIn problem - adding a sub-menu to the Edit menuNick Parker wrote: Chris Morrison wrote: However, when I try to add the CommandBar, a COMException is thrown with the message "Class not registered. Looking for object with CLID {.........}". It sounds as if the CLSID is not being found in the regisry, thus it is not able to load the COM Server because it doesn't know it's location. Are you using a third-party component that hasn't been registered? If so, pull up a command prompt, navigate to the directory of your COM .dll and type the following: regsvr32 "[YourComponent.dll]" That did not work and caused an error. I would have thought that any registrations that were required would be performed when I build and debug the Add-In. Also I have added a floating toolbar to the IDE with no problems, and I can add new items directly to the Edit menu with out error, so I can't see why I am having problems adding a sub menu to it. This is very strange.:confused::mad: Chris
-
Visual Studio AddIn problem - adding a sub-menu to the Edit menuHi all, I wonder if anyone can help with a problem I am having with an AddIn I am writing for Visual Studio.NET I am try to add a submenu to the Edit menu with two items in it. I would assume this is done by creating a CommandBar of type vsCommandBarTypeMenu and specifying the Edit menu as the parent, such as the code below:
CommandBar EditMenu = (CommandBar)applicationObject.CommandBars["Edit"]; ....... ......... CommandBar MySubMenu = (CommandBar)applicationObject.Commands.AddCommandBar("My Sub Menu", vsCommandBarType.vsCommandBarTypeMenu, EditMenu, 0);
However, when I try to add the CommandBar, a COMException is thrown with the message "Class not registered. Looking for object with CLID {.........}". What am I doing wrong here? Regards, Chris