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. Using a class!!!

Using a class!!!

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++asp-nethelpquestion
7 Posts 4 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
    Rickard Andersson20
    wrote on last edited by
    #1

    I have created a class now and want to test it. But the compiler says: fatal error C1010: unexpected end of file while looking for precompiled header directive In the .cpp file for my class I have in the beginning of the file #include "MyHeaderFile.h" and what can be wrong!? Rickard Andersson@Suza Computing C# and C++ programmer from SWEDEN! UIN: 50302279 E-Mail: nikado@pc.nu Speciality: I love C#, ASP.NET and C++!

    N M S 3 Replies Last reply
    0
    • R Rickard Andersson20

      I have created a class now and want to test it. But the compiler says: fatal error C1010: unexpected end of file while looking for precompiled header directive In the .cpp file for my class I have in the beginning of the file #include "MyHeaderFile.h" and what can be wrong!? Rickard Andersson@Suza Computing C# and C++ programmer from SWEDEN! UIN: 50302279 E-Mail: nikado@pc.nu Speciality: I love C#, ASP.NET and C++!

      N Offline
      N Offline
      Neville Franks
      wrote on last edited by
      #2

      Typically in MFC Apps you have a "stdafx.h" header file which is used as the precompiled header. Then in Project|Settings |C/C++ |Precompiled Headers you set "Use precompiled header file (.pch)" - "Through header: stdafx" If you aren't using precompiled headers then set "Not using precompiled headers" instead. See the VC++ Help for info on precompiled headers. Neville Franks, Author of ED for Windows. www.getsoft.com

      R 1 Reply Last reply
      0
      • R Rickard Andersson20

        I have created a class now and want to test it. But the compiler says: fatal error C1010: unexpected end of file while looking for precompiled header directive In the .cpp file for my class I have in the beginning of the file #include "MyHeaderFile.h" and what can be wrong!? Rickard Andersson@Suza Computing C# and C++ programmer from SWEDEN! UIN: 50302279 E-Mail: nikado@pc.nu Speciality: I love C#, ASP.NET and C++!

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        This is answered in the VC forum FAQ. --Mike-- Just released - RightClick-Encrypt v1.3 - Adds fast & easy file encryption to Explorer My really out-of-date homepage Sonork-100.19012 Acid_Helm

        1 Reply Last reply
        0
        • R Rickard Andersson20

          I have created a class now and want to test it. But the compiler says: fatal error C1010: unexpected end of file while looking for precompiled header directive In the .cpp file for my class I have in the beginning of the file #include "MyHeaderFile.h" and what can be wrong!? Rickard Andersson@Suza Computing C# and C++ programmer from SWEDEN! UIN: 50302279 E-Mail: nikado@pc.nu Speciality: I love C#, ASP.NET and C++!

          S Offline
          S Offline
          Space Ace
          wrote on last edited by
          #4

          How exactly did you create a class? A safe way of doing that is to create a simple AppWizard project and use Class Wizard to create a generic class. Thus Class Wizard will generate the headers so that you'll only need to add your code.

          R 1 Reply Last reply
          0
          • S Space Ace

            How exactly did you create a class? A safe way of doing that is to create a simple AppWizard project and use Class Wizard to create a generic class. Thus Class Wizard will generate the headers so that you'll only need to add your code.

            R Offline
            R Offline
            Rickard Andersson20
            wrote on last edited by
            #5

            Well I opened Notepad and wrote it by my own! :) Rickard Andersson@Suza Computing C# and C++ programmer from SWEDEN! UIN: 50302279 E-Mail: nikado@pc.nu Speciality: I love C#, ASP.NET and C++!

            S 1 Reply Last reply
            0
            • N Neville Franks

              Typically in MFC Apps you have a "stdafx.h" header file which is used as the precompiled header. Then in Project|Settings |C/C++ |Precompiled Headers you set "Use precompiled header file (.pch)" - "Through header: stdafx" If you aren't using precompiled headers then set "Not using precompiled headers" instead. See the VC++ Help for info on precompiled headers. Neville Franks, Author of ED for Windows. www.getsoft.com

              R Offline
              R Offline
              Rickard Andersson20
              wrote on last edited by
              #6

              I will try that out! Rickard Andersson@Suza Computing C# and C++ programmer from SWEDEN! UIN: 50302279 E-Mail: nikado@pc.nu Speciality: I love C#, ASP.NET and C++!

              1 Reply Last reply
              0
              • R Rickard Andersson20

                Well I opened Notepad and wrote it by my own! :) Rickard Andersson@Suza Computing C# and C++ programmer from SWEDEN! UIN: 50302279 E-Mail: nikado@pc.nu Speciality: I love C#, ASP.NET and C++!

                S Offline
                S Offline
                Space Ace
                wrote on last edited by
                #7

                VC++ adds some headers all by itself so you may have forgotten to include some file (this has already been said before). So just open VC++ and add a class with Class Wizard.

                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