none
Processing headerfiles with wpp RRS feed

  • Question

  • I believe this is a bug in Visual Studio 2012:

    When i add a header filename to the command line item of the WPP property page

    then the same header filename is displayed in the command line item of C/C++ property page:

    Accordingly the c++ compiler tries to compile the header file

    1>cl : Command line warning D9024: unrecognized source file type '..\src\dnsfilter.h', object file assumed
    1>cl : Command line warning D9027: source file '..\src\dnsfilter.h' ignored

    My intention to let the WPP preprocessor process my header file is not fulfilled, the command line item is solely processed by the c++ compiler.

    With regards, Jens

    Tuesday, December 4, 2012 2:05 PM

Answers

  • This issue has to do with how VS associates tools with items. an item can only associated with one tool, at least from a UI perspective. This makes it difficult to add headers to the WPP config in the UI because, as you see, things go sideways quickly.  We have a way to do this in the vcxproj using an <OtherWpp> item. we need to document it, but you can see it in action in the UMDF WPD sample.  You will automatically get OtherWpp items generated when you convert an nmake sources file to a vcxproj. Here is what the WPD snippet looks like

        <OtherWpp Include="WpdWudfSampleDriver.rc; WpdWudfSampleDriver.idl; DeviceObjectFakeContent.h; FakeContactContent.h; FakeContent.h; FakeDevice.h; FakeFolderContent.h; FakeImageContent.h; FakeMemoContent.h; FakeMusicContent.h; FakeVideoContent.h; NetworkConfigFakeContent.h; RenderingInformationFakeContent.h; StorageObjectFakeContent.h">
          <WppEnabled>true</WppEnabled>
          <WppDllMacro>true</WppDllMacro>
          <WppFileExtensions>.cpp.h.H</WppFileExtensions>
          <WppPreserveExtensions>.h.H</WppPreserveExtensions>
          <WppScanConfigurationData>stdafx.h</WppScanConfigurationData>
        </OtherWpp>


    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, December 4, 2012 5:35 PM

All replies

  • While this will not solve the problem, you might start with issuing the following command:

          Msbuild /t:clean,rebuild <vcxproj file> /v:diag

    And seeing how the wpp preprocessor is being invoked.  This may give you clues to how to get the files you need onto the command line.  Most projects don't need to worry about WPP tracing the includes (though I can see its value) so I think you are going to have to do the research.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Tuesday, December 4, 2012 2:15 PM
  • When you use Studio to compile it is generating a build log where the wpp preprocessor arguments can be checked, so no need to use msbuild.

    I digged a little bit deeper into this, and have now a solution for my problem:

    Visual Studio is adding "AdditionalOptions" nodes to the vcxproj file when changing the command line item from the property page. When i change all nodes from "AdditionalOptions" to "WppAdditionalOptions" and reload the project file my wpp preprocessor works as expected. Of course i cannot change anymore the header file list via the property page GUI until Microsoft is fixing this bug.

    Tuesday, December 4, 2012 2:45 PM
  • This issue has to do with how VS associates tools with items. an item can only associated with one tool, at least from a UI perspective. This makes it difficult to add headers to the WPP config in the UI because, as you see, things go sideways quickly.  We have a way to do this in the vcxproj using an <OtherWpp> item. we need to document it, but you can see it in action in the UMDF WPD sample.  You will automatically get OtherWpp items generated when you convert an nmake sources file to a vcxproj. Here is what the WPD snippet looks like

        <OtherWpp Include="WpdWudfSampleDriver.rc; WpdWudfSampleDriver.idl; DeviceObjectFakeContent.h; FakeContactContent.h; FakeContent.h; FakeDevice.h; FakeFolderContent.h; FakeImageContent.h; FakeMemoContent.h; FakeMusicContent.h; FakeVideoContent.h; NetworkConfigFakeContent.h; RenderingInformationFakeContent.h; StorageObjectFakeContent.h">
          <WppEnabled>true</WppEnabled>
          <WppDllMacro>true</WppDllMacro>
          <WppFileExtensions>.cpp.h.H</WppFileExtensions>
          <WppPreserveExtensions>.h.H</WppPreserveExtensions>
          <WppScanConfigurationData>stdafx.h</WppScanConfigurationData>
        </OtherWpp>


    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, December 4, 2012 5:35 PM