1. 程式人生 > >在新工程中新增ADo類後報錯解決辦法

在新工程中新增ADo類後報錯解決辦法

 --------------------Configuration: DLLDload - Win32 Debug--------------------
Compiling...
StdAfx.cpp
Compiling...
DLLDload.cpp
acl.cpp
e:\program_flies\recipe program\dlldload\debug\msjro.tlh(48) : error C2011: 'ReplicaTypeEnum' : 'enum' type redefinition
ado2.cpp
e:\program_flies\recipe program\dlldload\debug\msjro.tlh(48) : error C2011: 'ReplicaTypeEnum' : 'enum' type redefinition
E:\Program_Flies\Recipe Program\DLLDload\DB\ado2.cpp(1989) : error C2872: 'DataTypeEnum' : ambiguous symbol
E:\Program_Flies\Recipe Program\DLLDload\DB\ado2.cpp(1989) : error C2872: 'ParameterDirectionEnum' : ambiguous symbol
E:\Program_Flies\Recipe Program\DLLDload\DB\ado2.cpp(1989) : error C2664: 'CreateParameter' : cannot convert parameter 2 from 'enum DataTypeEnum' to 'enum ADODB::DataTypeEnum'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
E:\Program_Flies\Recipe Program\DLLDload\DB\ado2.cpp(2062) : error C2872: 'ParameterDirectionEnum' : ambiguous symbol
E:\Program_Flies\Recipe Program\DLLDload\DB\ado2.cpp(2062) : error C2664: 'PutDirection' : cannot convert parameter 1 from 'enum ParameterDirectionEnum' to 'enum ADODB::ParameterDirectionEnum'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
E:\Program_Flies\Recipe Program\DLLDload\DB\ado2.cpp(2065) : error C2872: 'DataTypeEnum' : ambiguous symbol
E:\Program_Flies\Recipe Program\DLLDload\DB\ado2.cpp(2065) : error C2664: 'PutType' : cannot convert parameter 1 from 'enum DataTypeEnum' to 'enum ADODB::DataTypeEnum'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
db.cpp
e:\program_flies\recipe program\dlldload\debug\msjro.tlh(48) : error C2011: 'ReplicaTypeEnum' : 'enum' type redefinition
appcfg.cpp
base_object.cpp
batch.cpp
bop.cpp
param.cpp
project.cpp
e:\program_flies\recipe program\dlldload\debug\msjro.tlh(48) : error C2011: 'ReplicaTypeEnum' : 'enum' type redefinition
E:\Program_Flies\Recipe Program\DLLDload\DOM\project.cpp(20) : error C2146: syntax error : missing ';' before identifier 'theApp'
E:\Program_Flies\Recipe Program\DLLDload\DOM\project.cpp(20) : fatal error C1004: unexpected end of file found
recipe.cpp
recipe_brand1.cpp
E:\Program_Flies\Recipe Program\DLLDload\DOM\recipe_brand1.cpp(70) : error C2039: 'addBOP' : is not a member of 'CRecipeBrand'
        e:\program_flies\recipe program\dlldload\dom\recipe_brand.h(17) : see declaration of 'CRecipeBrand'
E:\Program_Flies\Recipe Program\DLLDload\DOM\recipe_brand1.cpp(73) : error C2065: 'm_pParent' : undeclared identifier
E:\Program_Flies\Recipe Program\DLLDload\DOM\recipe_brand1.cpp(73) : error C2227: left of '->IsKindOf' must point to class/struct/union
E:\Program_Flies\Recipe Program\DLLDload\DOM\recipe_brand1.cpp(75) : error C2065: 'checkChildName' : undeclared identifier
E:\Program_Flies\Recipe Program\DLLDload\DOM\recipe_brand1.cpp(81) : error C2065: 'm_vecObject' : undeclared identifier
E:\Program_Flies\Recipe Program\DLLDload\DOM\recipe_brand1.cpp(81) : error C2228: left of '.size' must have class/struct/union type
E:\Program_Flies\Recipe Program\DLLDload\DOM\recipe_brand1.cpp(83) : error C2228: left of '.at' must have class/struct/union type
E:\Program_Flies\Recipe Program\DLLDload\DOM\recipe_brand1.cpp(83) : error C2227: left of '->getId' must point to class/struct/union
E:\Program_Flies\Recipe Program\DLLDload\DOM\recipe_brand1.cpp(103) : error C2039: 'removeBOP' : is not a member of 'CRecipeBrand'
        e:\program_flies\recipe program\dlldload\dom\recipe_brand.h(17) : see declaration of 'CRecipeBrand'
E:\Program_Flies\Recipe Program\DLLDload\DOM\recipe_brand1.cpp(105) : error C2227: left of '->IsKindOf' must point to class/struct/union
E:\Program_Flies\Recipe Program\DLLDload\DOM\recipe_brand1.cpp(109) : error C2228: left of '.size' must have class/struct/union type
E:\Program_Flies\Recipe Program\DLLDload\DOM\recipe_brand1.cpp(111) : error C2109: subscript requires array or pointer type
E:\Program_Flies\Recipe Program\DLLDload\DOM\recipe_brand1.cpp(115) : error C2228: left of '.erase' must have class/struct/union type
E:\Program_Flies\Recipe Program\DLLDload\DOM\recipe_brand1.cpp(115) : error C2228: left of '.begin' must have class/struct/union type
E:\Program_Flies\Recipe Program\DLLDload\DOM\recipe_brand1.cpp(123) : error C2039: 'getBOPCount' : is not a member of 'CRecipeBrand'
        e:\program_flies\recipe program\dlldload\dom\recipe_brand.h(17) : see declaration of 'CRecipeBrand'
E:\Program_Flies\Recipe Program\DLLDload\DOM\recipe_brand1.cpp(125) : error C2227: left of '->IsKindOf' must point to class/struct/union
E:\Program_Flies\Recipe Program\DLLDload\DOM\recipe_brand1.cpp(127) : error C2228: left of '.size' must have class/struct/union type
E:\Program_Flies\Recipe Program\DLLDload\DOM\recipe_brand1.cpp(130) : error C2039: 'getBOP' : is not a member of 'CRecipeBrand'
        e:\program_flies\recipe program\dlldload\dom\recipe_brand.h(17) : see declaration of 'CRecipeBrand'
E:\Program_Flies\Recipe Program\DLLDload\DOM\recipe_brand1.cpp(132) : error C2227: left of '->IsKindOf' must point to class/struct/union
E:\Program_Flies\Recipe Program\DLLDload\DOM\recipe_brand1.cpp(134) : error C2228: left of '.size' must have class/struct/union type
E:\Program_Flies\Recipe Program\DLLDload\DOM\recipe_brand1.cpp(135) : error C2109: subscript requires array or pointer type
E:\Program_Flies\Recipe Program\DLLDload\DOM\recipe_brand1.cpp(275) : error C2039: '__getBOPStepNumber' : is not a member of 'CRecipeBrand'
        e:\program_flies\recipe program\dlldload\dom\recipe_brand.h(17) : see declaration of 'CRecipeBrand'
E:\Program_Flies\Recipe Program\DLLDload\DOM\recipe_brand1.cpp(279) : error C2228: left of '.size' must have class/struct/union type
E:\Program_Flies\Recipe Program\DLLDload\DOM\recipe_brand1.cpp(281) : error C2109: subscript requires array or pointer type
E:\Program_Flies\Recipe Program\DLLDload\DOM\recipe_brand1.cpp(281) : error C2681: 'int' : invalid expression type for dynamic_cast
recipe_brand.cpp
recipe_config.cpp
recipe_list.cpp
recipe_type.cpp
shell.cpp

開啟“stdafx.h”檔案把一下程式遮蔽,導致原因是由於afxdao和新加類中一些資料來源的重複定義導致

#ifndef _AFX_NO_DAO_SUPPORT
#include <afxdao.h>   // MFC DAO database classes
#endif // _AFX_NO_DAO_SUPPORT