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. Class Construction Problem

Class Construction Problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionc++
4 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.
  • B Offline
    B Offline
    bugDanny
    wrote on last edited by
    #1

    I'm running into a problem contstructin a class. I'm trying to inherit the CObList class. So far I just added a default constructor and a struct. Here's the code:

    #ifndef FAF_H
    #define FAF_H

    // CFAFList class declaration

    class CFAFList : public CObList
    {
    protected:
    struct FAFRecord
    {
    CString name;
    CString address;
    CString HomePhone;
    CString WorkPhone;
    CString CelPhone;
    CString FaxNumber;
    }m_FafRecord;

    public:
    CFAFList();
    };
    #endif

    And here's the source code for my new class:

    #include "FAFList.h"

    //**************************************
    // Definition of CFAFList constructor. *
    //**************************************

    CFAFList::CFAFList()
    {
    m_FafRecord->name = "";
    m_FafRecord->address = "";
    m_FafRecord->HomePhone = "";
    m_FafRecord->WorkPhone = "";
    m_FafRecord->CelPhone = "";
    m_FafRecord->FaxNumber = "";
    }

    My problem is, when I try to compile this, I get p:\findafolk\faflist.cpp(17) : fatal error C1010: unexpected end of file while looking for precompiled header directive as an error. How do I fix this? Danny The stupidity of others amazes me!

    T C 2 Replies Last reply
    0
    • B bugDanny

      I'm running into a problem contstructin a class. I'm trying to inherit the CObList class. So far I just added a default constructor and a struct. Here's the code:

      #ifndef FAF_H
      #define FAF_H

      // CFAFList class declaration

      class CFAFList : public CObList
      {
      protected:
      struct FAFRecord
      {
      CString name;
      CString address;
      CString HomePhone;
      CString WorkPhone;
      CString CelPhone;
      CString FaxNumber;
      }m_FafRecord;

      public:
      CFAFList();
      };
      #endif

      And here's the source code for my new class:

      #include "FAFList.h"

      //**************************************
      // Definition of CFAFList constructor. *
      //**************************************

      CFAFList::CFAFList()
      {
      m_FafRecord->name = "";
      m_FafRecord->address = "";
      m_FafRecord->HomePhone = "";
      m_FafRecord->WorkPhone = "";
      m_FafRecord->CelPhone = "";
      m_FafRecord->FaxNumber = "";
      }

      My problem is, when I try to compile this, I get p:\findafolk\faflist.cpp(17) : fatal error C1010: unexpected end of file while looking for precompiled header directive as an error. How do I fix this? Danny The stupidity of others amazes me!

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      before the #include "FAFList.h", #include "stdafx.h" header...


      TOXCCT >>> GEII power
      [toxcct][VisualCalc]

      1 Reply Last reply
      0
      • B bugDanny

        I'm running into a problem contstructin a class. I'm trying to inherit the CObList class. So far I just added a default constructor and a struct. Here's the code:

        #ifndef FAF_H
        #define FAF_H

        // CFAFList class declaration

        class CFAFList : public CObList
        {
        protected:
        struct FAFRecord
        {
        CString name;
        CString address;
        CString HomePhone;
        CString WorkPhone;
        CString CelPhone;
        CString FaxNumber;
        }m_FafRecord;

        public:
        CFAFList();
        };
        #endif

        And here's the source code for my new class:

        #include "FAFList.h"

        //**************************************
        // Definition of CFAFList constructor. *
        //**************************************

        CFAFList::CFAFList()
        {
        m_FafRecord->name = "";
        m_FafRecord->address = "";
        m_FafRecord->HomePhone = "";
        m_FafRecord->WorkPhone = "";
        m_FafRecord->CelPhone = "";
        m_FafRecord->FaxNumber = "";
        }

        My problem is, when I try to compile this, I get p:\findafolk\faflist.cpp(17) : fatal error C1010: unexpected end of file while looking for precompiled header directive as an error. How do I fix this? Danny The stupidity of others amazes me!

        C Offline
        C Offline
        Cedric Moonen
        wrote on last edited by
        #3

        Remove the #include "stdafx.h" line at the top of your faflist.cpp file -- modified at 10:54 Monday 17th October, 2005 Mmmhh, sorry :~ . It was adding the file not remove it ;P. A second solution is to specify that this file don't use precompiled headers.

        B 1 Reply Last reply
        0
        • C Cedric Moonen

          Remove the #include "stdafx.h" line at the top of your faflist.cpp file -- modified at 10:54 Monday 17th October, 2005 Mmmhh, sorry :~ . It was adding the file not remove it ;P. A second solution is to specify that this file don't use precompiled headers.

          B Offline
          B Offline
          bugDanny
          wrote on last edited by
          #4

          Thank you both. Danny The stupidity of others amazes me!

          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