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. error C2011: 'CDataGrid' : 'class' type redefinition

error C2011: 'CDataGrid' : 'class' type redefinition

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionlearning
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.
  • S Offline
    S Offline
    sdancer75
    wrote on last edited by
    #1

    Using the MS DataGrid in two different dialogs but in the same parent dialog I get the following error :\library\librarian\datagrid.h(13) : error C2011: 'CDataGrid' : 'class' type redefinition What should i do to solve this problem ? Check the following : In the main parent dialog with the name Properties.h i include the #include "BookNewDonator.h" #include "BookNewSupplier.h" which each of them has a DataGrid member in their classes and of course they include the "datagrid.h" What sould i do ? sdancer75

    P V S 3 Replies Last reply
    0
    • S sdancer75

      Using the MS DataGrid in two different dialogs but in the same parent dialog I get the following error :\library\librarian\datagrid.h(13) : error C2011: 'CDataGrid' : 'class' type redefinition What should i do to solve this problem ? Check the following : In the main parent dialog with the name Properties.h i include the #include "BookNewDonator.h" #include "BookNewSupplier.h" which each of them has a DataGrid member in their classes and of course they include the "datagrid.h" What sould i do ? sdancer75

      P Offline
      P Offline
      Phil J Pearson
      wrote on last edited by
      #2

      Add

      #pragma once

      to the top of datagrid.h


      The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).

      1 Reply Last reply
      0
      • S sdancer75

        Using the MS DataGrid in two different dialogs but in the same parent dialog I get the following error :\library\librarian\datagrid.h(13) : error C2011: 'CDataGrid' : 'class' type redefinition What should i do to solve this problem ? Check the following : In the main parent dialog with the name Properties.h i include the #include "BookNewDonator.h" #include "BookNewSupplier.h" which each of them has a DataGrid member in their classes and of course they include the "datagrid.h" What sould i do ? sdancer75

        V Offline
        V Offline
        vallikumar
        wrote on last edited by
        #3

        Use preprossor if condition to check datagrid.h file included already or not. mean you have to write the datagrid.h codes inside the #define directive. Example.. #if !defined(DATAGRID_H__INCLUDED_) #define DATAGRID_H__INCLUDED_ ...... #endif // DATAGRID_H__INCLUDED_ regards Vallikumar A

        1 Reply Last reply
        0
        • S sdancer75

          Using the MS DataGrid in two different dialogs but in the same parent dialog I get the following error :\library\librarian\datagrid.h(13) : error C2011: 'CDataGrid' : 'class' type redefinition What should i do to solve this problem ? Check the following : In the main parent dialog with the name Properties.h i include the #include "BookNewDonator.h" #include "BookNewSupplier.h" which each of them has a DataGrid member in their classes and of course they include the "datagrid.h" What sould i do ? sdancer75

          S Offline
          S Offline
          sdancer75
          wrote on last edited by
          #4

          The #pragma once solved the error ! Thank you ! sdancer75

          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