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. Including a class in an MFC project

Including a class in an MFC project

Scheduled Pinned Locked Moved C / C++ / MFC
c++questionworkspace
2 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.
  • L Offline
    L Offline
    Lilith C
    wrote on last edited by
    #1

    I've made this work but I'm wondering if there's a better way that I'm overlooking. So, I've developed a sub-class of a CEdit control in a development environment. I've got the two files MyCEdit.cpp and MyCEdit.h sitting in a directory of my development environment. My latest and greatest (at least most time consuming) project needs to use the new class object. I can't use New Class because that means I have to start from scratch. I can't add the class from a type library coz it isn't in one. So all I can do, and have done, is include the two files in my project. At this point the class wizard doesn't appear to know that CMyCEdit exists. Under Member Variables/Add Variable the Variable Type doesn't know that I've just introduced CMyEdit. I include MyCEdit.h in the ??????Dlg.h file and no difference. In order to make the class appear in the class wizard I have to make sure that the class header file is #included in either the dialog or view header. I then delete/rename the .CLW file, invoke the class wizard which then offers to rebuild the class data from the files involved. Certainly there has to be a better way to do this more directly through VC++. :confused: TIA, Lilith

    D 1 Reply Last reply
    0
    • L Lilith C

      I've made this work but I'm wondering if there's a better way that I'm overlooking. So, I've developed a sub-class of a CEdit control in a development environment. I've got the two files MyCEdit.cpp and MyCEdit.h sitting in a directory of my development environment. My latest and greatest (at least most time consuming) project needs to use the new class object. I can't use New Class because that means I have to start from scratch. I can't add the class from a type library coz it isn't in one. So all I can do, and have done, is include the two files in my project. At this point the class wizard doesn't appear to know that CMyCEdit exists. Under Member Variables/Add Variable the Variable Type doesn't know that I've just introduced CMyEdit. I include MyCEdit.h in the ??????Dlg.h file and no difference. In order to make the class appear in the class wizard I have to make sure that the class header file is #included in either the dialog or view header. I then delete/rename the .CLW file, invoke the class wizard which then offers to rebuild the class data from the files involved. Certainly there has to be a better way to do this more directly through VC++. :confused: TIA, Lilith

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

      Lilith.C wrote:

      Certainly there has to be a better way to do this more directly through VC++.

      Not necessarily. Deleting a project's temporary files (e.g., ncb, opt, clw, aps) is actually quite common.


      "The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb

      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