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. Visual Studio
  4. Visibility of MFC Classes

Visibility of MFC Classes

Scheduled Pinned Locked Moved Visual Studio
c++visual-studioquestion
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.
  • Richard Andrew x64R Offline
    Richard Andrew x64R Offline
    Richard Andrew x64
    wrote on last edited by
    #1

    If I specify a class member in one of my header files that uses a class I have defined, I must either use a forward declaration or include that class's header file. However, I can use all of the MFC classes in any header file without a forward declaration or including the class's header file. What VS Project options allow this to be the case?

    The difficult we do right away... ...the impossible takes slightly longer.

    L A 2 Replies Last reply
    0
    • Richard Andrew x64R Richard Andrew x64

      If I specify a class member in one of my header files that uses a class I have defined, I must either use a forward declaration or include that class's header file. However, I can use all of the MFC classes in any header file without a forward declaration or including the class's header file. What VS Project options allow this to be the case?

      The difficult we do right away... ...the impossible takes slightly longer.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      The MFC headers are automatically added by the MFC templates provided in Visual Studio. Look in the stdafx.h header of your project.

      Veni, vidi, abiit domum

      1 Reply Last reply
      0
      • Richard Andrew x64R Richard Andrew x64

        If I specify a class member in one of my header files that uses a class I have defined, I must either use a forward declaration or include that class's header file. However, I can use all of the MFC classes in any header file without a forward declaration or including the class's header file. What VS Project options allow this to be the case?

        The difficult we do right away... ...the impossible takes slightly longer.

        A Offline
        A Offline
        Albert Holguin
        wrote on last edited by
        #3

        It's pretty much what Richard said... try to use an MFC class in a C/C++ file that's configured as "not using a precompiled header" and you'll have the same requirement of including/forward declaring.

        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