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. C / C++ / MFC
  4. WINDOWS.H already included. MFC apps must not #include <windows.h></windows.h>

WINDOWS.H already included. MFC apps must not #include <windows.h></windows.h>

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
3 Posts 3 Posters 0 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.
  • D Offline
    D Offline
    dehseth
    wrote on last edited by
    #1

    hi ppl, I got this framework which obiously includes windows.h... :mad: And I got a static library which includes afxwin.h. I need afxwin.h because I want to use CCmdTarget class. And I got this error: WINDOWS.H already included. MFC apps must not #include <windows.h> :mad: I am not creating a MFC application and I need CCmdTarget class and I cannot remove windows.h... :~ Any workarounds?? :confused: Thank you all.. :)

    _ R 2 Replies Last reply
    0
    • D dehseth

      hi ppl, I got this framework which obiously includes windows.h... :mad: And I got a static library which includes afxwin.h. I need afxwin.h because I want to use CCmdTarget class. And I got this error: WINDOWS.H already included. MFC apps must not #include <windows.h> :mad: I am not creating a MFC application and I need CCmdTarget class and I cannot remove windows.h... :~ Any workarounds?? :confused: Thank you all.. :)

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      The CCmdTarget class is part of MFC. So you don't have the option of not using MFC.

      «_Superman_» I love work. It gives me something to do between weekends.

      1 Reply Last reply
      0
      • D dehseth

        hi ppl, I got this framework which obiously includes windows.h... :mad: And I got a static library which includes afxwin.h. I need afxwin.h because I want to use CCmdTarget class. And I got this error: WINDOWS.H already included. MFC apps must not #include <windows.h> :mad: I am not creating a MFC application and I need CCmdTarget class and I cannot remove windows.h... :~ Any workarounds?? :confused: Thank you all.. :)

        R Offline
        R Offline
        Rajesh R Subramanian
        wrote on last edited by
        #3

        You can include all the MFC stuff first. This way, you can be sure that windows.h is already included for the framework that comes next. But, like the other poster said, you are going to be building an MFC application.

        It is a crappy thing, but it's life -^ Carlo Pallini

        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