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. Weird Problem

Weird Problem

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

    Well I have a weird problem. I have declared a stucture called BrowseBoxStruct in the header file BBDefinition.h as follows #ifndef __BBOXSTRUCT__ #define __BBOXSTRUCT__ struct MyStruct { CString column_name; int column_width; _variant_t table_column_name; }; typedef MyStruct BrowseBoxStruct; #endif Now I want to pass it to the constructor of a class (CBrowse in Browse.h and Browse.cpp) so I changed the standard constructor for the class as follows. CBrowse(CWnd* pParent = NULL, BrowseBoxStruct* pBbx = NULL); and in the cpp file I have CBrowse::CBrowse(CWnd* pParent /*=NULL*/, BrowseBoxStruct* pBbx) : CDialog(CBrowse::IDD, pParent){ //{{AFX_DATA_INIT(CBrowse) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT} } But when I build the application I get the follwoing errors c:\coursemanager\browse.h(18) : error C2629: unexpected 'class CBrowse (' c:\coursemanager\browse.h(18) : error C2238: unexpected token(s) preceding ';' C:\CourseManager\Browse.cpp(20) : error C2511: 'CBrowse::CBrowse' : overloaded member function 'void (class CWnd*, struct MyStruct*)' not found in 'CBrowse'C:\CourseManager\Browse.cpp(94) : fatal error C1004: unexpected end of file found Please tell me what is going wrong? I included the header file for the structure in the cpp file of my class. I did not forget to add ; in the header file BBDefinition which defines the structure. Still what is going wrong? Mike :(

    N 1 Reply Last reply
    0
    • M mvworld

      Well I have a weird problem. I have declared a stucture called BrowseBoxStruct in the header file BBDefinition.h as follows #ifndef __BBOXSTRUCT__ #define __BBOXSTRUCT__ struct MyStruct { CString column_name; int column_width; _variant_t table_column_name; }; typedef MyStruct BrowseBoxStruct; #endif Now I want to pass it to the constructor of a class (CBrowse in Browse.h and Browse.cpp) so I changed the standard constructor for the class as follows. CBrowse(CWnd* pParent = NULL, BrowseBoxStruct* pBbx = NULL); and in the cpp file I have CBrowse::CBrowse(CWnd* pParent /*=NULL*/, BrowseBoxStruct* pBbx) : CDialog(CBrowse::IDD, pParent){ //{{AFX_DATA_INIT(CBrowse) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT} } But when I build the application I get the follwoing errors c:\coursemanager\browse.h(18) : error C2629: unexpected 'class CBrowse (' c:\coursemanager\browse.h(18) : error C2238: unexpected token(s) preceding ';' C:\CourseManager\Browse.cpp(20) : error C2511: 'CBrowse::CBrowse' : overloaded member function 'void (class CWnd*, struct MyStruct*)' not found in 'CBrowse'C:\CourseManager\Browse.cpp(94) : fatal error C1004: unexpected end of file found Please tell me what is going wrong? I included the header file for the structure in the cpp file of my class. I did not forget to add ; in the header file BBDefinition which defines the structure. Still what is going wrong? Mike :(

      N Offline
      N Offline
      Nish Nishant
      wrote on last edited by
      #2

      You sure you have #include "stdafx.h" as the first line in your cpp file? Nish Sonork ID 100.9786 voidmain
      www.busterboy.org
      Nish is a BIG fan of Goran Ivanisevic

      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