nativeMethod error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • GS

    nativeMethod error

    I was attempting to use the
    Guid("B722BCCB-4E68-101B-A2BC-00AA00404770")
    for IOleCommandTarg et
    and Guid("D30C1661-CDAF-11d0-8A3E-00C04FC9E26E") for interface IwebBrowser2

    However I got errro
    Error 1 'System.Drawing .NativeMethods' is inaccessible due to its protection
    level c:\webCtlExtend ed\WebCtlExtend ed.cs 182 50 webCtlExtended
    and
    Error 2 The type name 'OLECMDID' does not exist in the type
    'System.Drawing .NativeMethods'
    C:\webCtlExtend ed\webCtlExtend ed\WebCtlExtend ed.cs 182 64 webCtlExtended


    for

    [DispId(0x1f5)]
    NativeMethods.O LECMDF QueryStatusWB([In] NativeMethods.O LECMDID
    cmdID);
    [DispId(0x1f6)]
    void ExecWB([In] NativeMethods.O LECMDID cmdID, [In]
    NativeMethods.O LECMDEXECOPT cmdexecopt, ref object pvaIn, IntPtr pvaOut);


    it appears that the the guid ofr IWebBrowser is wrong
    I am using C3 2008 express with target being .net 3.5


  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: nativeMethod error

    GS,

    Without seeing the relevant code (a short, complete example would be
    better), it's difficult to say.

    However, the errors indicate that something else is going on. First, it
    seems you are trying to access something that is not visible to your code.
    The NativeMethods type in the System.Drawing namespace is more than likely
    internal to System.Drawing. dll, so I'm not surprized about this.

    What exactly are you trying to do? Are you trying to use the OLECMDID
    type in a definition of the IOleCommandTarg et and IWebBrowser2 interfaces
    that you are declaring yourself? If so, you will have to declare this type
    yourself, which isn't too hard given the header file (docobj.h).

    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "GS" <gsmsnews.micro soft.comGS@msne ws.Nomail.comwr ote in message
    news:O1%233D3fd IHA.5984@TK2MSF TNGP06.phx.gbl. ..
    >I was attempting to use the
    Guid("B722BCCB-4E68-101B-A2BC-00AA00404770")
    for IOleCommandTarg et
    and Guid("D30C1661-CDAF-11d0-8A3E-00C04FC9E26E") for interface
    IwebBrowser2
    >
    However I got errro
    Error 1 'System.Drawing .NativeMethods' is inaccessible due to its
    protection
    level c:\webCtlExtend ed\WebCtlExtend ed.cs 182 50 webCtlExtended
    and
    Error 2 The type name 'OLECMDID' does not exist in the type
    'System.Drawing .NativeMethods'
    C:\webCtlExtend ed\webCtlExtend ed\WebCtlExtend ed.cs 182 64 webCtlExtended
    >
    >
    for
    >
    [DispId(0x1f5)]
    NativeMethods.O LECMDF QueryStatusWB([In] NativeMethods.O LECMDID
    cmdID);
    [DispId(0x1f6)]
    void ExecWB([In] NativeMethods.O LECMDID cmdID, [In]
    NativeMethods.O LECMDEXECOPT cmdexecopt, ref object pvaIn, IntPtr pvaOut);
    >
    >
    it appears that the the guid ofr IWebBrowser is wrong
    I am using C3 2008 express with target being .net 3.5
    >
    >

    Comment

    Working...