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. Building with Warning level 4

Building with Warning level 4

Scheduled Pinned Locked Moved Managed C++/CLI
c++helpquestionannouncement
2 Posts 1 Posters 3 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.
  • J Offline
    J Offline
    John Schroedl
    wrote on last edited by
    #1

    Hi, I'm trying to build my C++/CLI project with /W4 today and there's a warning I can't seem to avoid and hope someone here can help. My project has a reference to Microsoft.mshtml for the web browser interfaces. At the first usage in code, I get a slew of warning similar to this:

    1>htmlView.cpp(244): warning C4564: method 'open' of interface 'mshtml::DispHTMLDocument' defines unsupported default parameter 'url'
    1> This diagnostic occurred while importing type 'mshtml::DispHTMLDocument ' from assembly 'Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
    1> This diagnostic occurred while importing type 'mshtml::HTMLDocumentClass ' from assembly 'Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

    I understand why it's warning (there are optional parameters in the managed interface but the generated C++ interface doesn't have the default values). That's fine.. I'd like to suppress the warning since I can't really do anything about the generated code. I tried the following in various of places in the code including wrapping the whole file with it. Alas, it doesn't prevent the warning.

    #pragma warning( push )
    #pragma warning( suppress : 4564 ) // /W4 will warn about optional parameters in mshtml interface

    . . . CLI Code . . .

    #pragma warning(pop)

    If possible, I'd prefer to suppress it in the source instead of a compile-time switch so I thought I'd ask here... any suggestions? John

    J 1 Reply Last reply
    0
    • J John Schroedl

      Hi, I'm trying to build my C++/CLI project with /W4 today and there's a warning I can't seem to avoid and hope someone here can help. My project has a reference to Microsoft.mshtml for the web browser interfaces. At the first usage in code, I get a slew of warning similar to this:

      1>htmlView.cpp(244): warning C4564: method 'open' of interface 'mshtml::DispHTMLDocument' defines unsupported default parameter 'url'
      1> This diagnostic occurred while importing type 'mshtml::DispHTMLDocument ' from assembly 'Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
      1> This diagnostic occurred while importing type 'mshtml::HTMLDocumentClass ' from assembly 'Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

      I understand why it's warning (there are optional parameters in the managed interface but the generated C++ interface doesn't have the default values). That's fine.. I'd like to suppress the warning since I can't really do anything about the generated code. I tried the following in various of places in the code including wrapping the whole file with it. Alas, it doesn't prevent the warning.

      #pragma warning( push )
      #pragma warning( suppress : 4564 ) // /W4 will warn about optional parameters in mshtml interface

      . . . CLI Code . . .

      #pragma warning(pop)

      If possible, I'd prefer to suppress it in the source instead of a compile-time switch so I thought I'd ask here... any suggestions? John

      J Offline
      J Offline
      John Schroedl
      wrote on last edited by
      #2

      I gave up and am disabling this warning for the affected file in the vcxproj. Oh well, would have been nice to suppress in source. John

      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