enum Datatype: Overloaded function differ only by return type error...?
-
Hi, I am working on a project in Visual C++ 6.0. I have included the following statements in a file:
\#import "C:\Program Files\Common Files\System\ado\msado15.dll" \
rename( "EOF", "adoEOF" )
\#import "c:\Program Files\Common Files\system\ado\msadox.dll" \
no_namespaceI am getting the following error:
error C2556: 'enum DataTypeEnum __thiscall ADODB::Field20::GetType(void)' : overloaded function differs only by return type from 'enum ADODB::DataTypeEnum __thiscall ADODB::Field20::GetType(void)'
Any idea why this error is generated...? How to resolve the above issue...? Regards, mba
-
Hi, I am working on a project in Visual C++ 6.0. I have included the following statements in a file:
\#import "C:\Program Files\Common Files\System\ado\msado15.dll" \
rename( "EOF", "adoEOF" )
\#import "c:\Program Files\Common Files\system\ado\msadox.dll" \
no_namespaceI am getting the following error:
error C2556: 'enum DataTypeEnum __thiscall ADODB::Field20::GetType(void)' : overloaded function differs only by return type from 'enum ADODB::DataTypeEnum __thiscall ADODB::Field20::GetType(void)'
Any idea why this error is generated...? How to resolve the above issue...? Regards, mba
-
Hi, I am working on a project in Visual C++ 6.0. I have included the following statements in a file:
\#import "C:\Program Files\Common Files\System\ado\msado15.dll" \
rename( "EOF", "adoEOF" )
\#import "c:\Program Files\Common Files\system\ado\msadox.dll" \
no_namespaceI am getting the following error:
error C2556: 'enum DataTypeEnum __thiscall ADODB::Field20::GetType(void)' : overloaded function differs only by return type from 'enum ADODB::DataTypeEnum __thiscall ADODB::Field20::GetType(void)'
Any idea why this error is generated...? How to resolve the above issue...? Regards, mba
Richard was spot on ADO and ADOX both use the no_namespace option you need to rename the functions of one into a renamed namespace
#import "..\..\..\dll\msadox.dll" // Importing Adox unchanged in this example
#import "..\..\..\dll\msado15.dll" no_namespace rename("EOF", "EOFADO")rename("DataTypeEnum", "DataTypeEnumADO") rename("EditModeEnum", "EditModeEnumADO") \
rename("FieldAttributeEnum", "FieldAttributeEnumADO") rename("LockTypeEnum", "LockTypeEnumADO") // Rename each function you want to use into current namespace with ADO at end// The ADO at the end just makes remembering the name easy
You could choose to import the ADO and rename the ADOX functions, rename the one you use least.
In vino veritas