Weird Problem
-
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 :(
-
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 :(
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