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. Newbie CFile problem

Newbie CFile problem

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestiondiscussion
4 Posts 2 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.
  • R Offline
    R Offline
    robdillon1
    wrote on last edited by
    #1

    Any thoughts on the problem below will be a great help: I am trying to use CFile in an MFC app. My thinking is that it should be available with no further includes as stdafx is included which includes windows.h? However vc++ tell me CFile is an undeclared identifier. CFile is declared in afx.h however I can't include afx.h by itself as the compiler complains that windows.h is being redeclared. What am I missing... Just another typist

    D 1 Reply Last reply
    0
    • R robdillon1

      Any thoughts on the problem below will be a great help: I am trying to use CFile in an MFC app. My thinking is that it should be available with no further includes as stdafx is included which includes windows.h? However vc++ tell me CFile is an undeclared identifier. CFile is declared in afx.h however I can't include afx.h by itself as the compiler complains that windows.h is being redeclared. What am I missing... Just another typist

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      By default, windows.h is not directly included in stdafx.h. You should have at least included afxwin.h. Others you might have are afxext.h and afxdtctl.h.


      "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

      R 1 Reply Last reply
      0
      • D David Crow

        By default, windows.h is not directly included in stdafx.h. You should have at least included afxwin.h. Others you might have are afxext.h and afxdtctl.h.


        "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

        R Offline
        R Offline
        robdillon1
        wrote on last edited by
        #3

        Many thanks! This has pointed me on the right track. I have found similar posts and the answer seems to be afxwin.h. Unfortunately I still can't compile: _DllMain@12 already defined in HookFunc.obj I have found a Microdoft specific knwledge base article describing this problem but that relates to specific modules that there is a problem with. I don't think that's what I'm seeing, more likely I'm just doing something dumb. Just another typist

        D 1 Reply Last reply
        0
        • R robdillon1

          Many thanks! This has pointed me on the right track. I have found similar posts and the answer seems to be afxwin.h. Unfortunately I still can't compile: _DllMain@12 already defined in HookFunc.obj I have found a Microdoft specific knwledge base article describing this problem but that relates to specific modules that there is a problem with. I don't think that's what I'm seeing, more likely I'm just doing something dumb. Just another typist

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          It appears that you have more than one instance of DllMain() in the project's .c or .cpp files.


          "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

          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