.NET Conflicting documentation iWebBrowser2, ScriptErrorsSuppressed

คำตอบ .NET Conflicting documentation iWebBrowser2, ScriptErrorsSuppressed

  • 18 สิงหาคม 2555 14:37
     
     

    According to

    http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.scripterrorssuppressed.aspx

    Every WebBrowser and IWebBrowser2 has a public property, which in C++ looks like

    public:
    property bool ScriptErrorsSuppressed {
    bool get ();
    void set (bool value);
    }

    ==============================================

    According to

    http://msdn.microsoft.com/en-US/vstudio/aa496123

    .NET Framework
    .NET Framework Highlights
    Download Visual Studio 2012
    Install and try Visual Studio 2012 today.<<<<<<

    .NET Framework 4.5
    Download the NET Framework 4.5 today.<<<<<<

    The way to develop a .NET 4.5 is to use Visua Studio and the Downloaded .NET.

    Oddly, the .Net download listed below Visual Studio appears to have no developer SDK at all (so is useless to Visual Studio).

    In any case, I installed this .NET update.

    =====================================

    This page says it has the .NET SDK for Visual Studio, 2005, 2008 and 2010

    http://www.microsoft.com/en-us/download/details.aspx?id=8279

    After install, I have an SDK version 7.x, newer than the version 6.x that came with my Visual Studio 2008,

    and according to this page, the "latest" SDK

    but

    nav->ScriptErrorsSuppressed = true;

    gives error 

    error C2039: 'ScriptErrorsSuppressed' : is not a member of 'IWebBrowser2'
            C:\Program Files\Microsoft SDKs\Windows\v7.1\\include\exdisp.h(1310) : see declaration of 'IWebBrowser2'

    And SDK 7.x exDisp.h does indeed have a declaration of iWebBrowser2, and it and its parent classes

    iWebBrrowser and WebBrowser also do not have it, nor do they have the bulk of the properties listed in the documentation at top of this post.

    A search of the SDK shows no other definitions for iWebBrowser2 except this one in v7.1\include\exdisp.h.

    So, is the documentation really that broken that it has dozens of properties and methods never implemented,

    Or is the page that says its the SDK for .NET wrong,

    Or am I just missing something really basic here?

ตอบทั้งหมด

  • 18 สิงหาคม 2555 17:21
     
     

    There are a few differnt version of the WebBrowser2 library.  Some webpages go back to Visual Studio 6 (which is a differnet library Net 5.0), some are used in VBA, and other with Net Library.  I think all of them realy use the same dll in the system32 folder but provide a different interface.  You can sometimes can convert one version of the library to code that works with another version, and sometimes you can't. I have problems tying to use some of the same code in VBA macros which can't type cast from one type to another.  I also have a lot of problems in C# which also sometimes gives errors when casting types.  I like plain old C language where you could cast any type to any other type without all these silly error messages.

    Visual Studion 6 had a different compile and library for each language (C++ and Basic).  Then Microsoft combined C++, C#, and Basic into the same librariesand came out with Visual Studio 2008 with libaries Net 1.0, 2.0, 3.0, 3.5.  Be careful that each verion of Net Libaary have differnet methods so you need all installed.


    jdweng

  • 21 สิงหาคม 2555 15:29
     
     

    An addendum for anyone following the thread.

    I offered a FreeLance Project which consisted of 

    Declare a .NET iWebBrowser2, assign to SuppressScriptErrors property, and compile.

    Got multiple FreeLancers bid, none could do it. One said it could be done in Visual Studio 2012. Could not verify, don't have it.

    The "FrameWorkSDK" in visual studio 2008 points to the regular Windows SDK.
    Which is what is loaded if you download the ".NET SDK" from 

    http://www.microsoft.com/en-us/download/details.aspx?id=8279
    Page title is "Microsoft Windows SDK for Windows 7 and .NET Framework 4"

    It does NOT have the dozens of extra properties and methods documented by .NET over and above the Windows SDK iWebBrowser2, because its the SAME Windows SDK, v7.1, not a .NET SDK, if there ever was one.

    The .NET run times that get installed in Windows may well have additional features, but its pointless since no SDK lets you access them.

    And last, this "feature" is documented as available since .NET 2.x, and .NET 4.5 advertises compatibility with Visual Studio 2005 and 2008.

    Is anyone minding the store?


    • แก้ไขโดย mrbi11 21 สิงหาคม 2555 15:32
    •  
  • 22 สิงหาคม 2555 11:06
    ผู้ดูแล
     
     คำตอบ

    Hi Mrb,

    Welcome to the MSDN Forum.

    What kind of your project is? Is it c++/cli: http://msdn.microsoft.com/en-us/magazine/cc163852.aspx 

    IWebBrowser2 is a native reference: http://msdn.microsoft.com/en-us/library/aa752127(v=vs.85).aspx 

    It doesn't have such property.

    But the managed reference has one: http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.scripterrorssuppressed.aspx#Y0 

    They are different references. So I think they are not conflict with each other.

    If you want to use this property, please try C++/CLI.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.