ado封装,该怎么处理
ado封装
#import "C:\program files\common files\System\ado\msado15.dll" no_namespace \
rename("EOF","EndOfFile") \
rename("LockTypeEnum","newLockTypeEnum")\
rename("DataTypeEnum","newDataTypeEnum")\
rename("FieldAttributeEnum","newFieldAttributeEnum")\
rename("EditModeEnum","newEditModeEnum")\
rename("RecordStatusEnum","newRecordStatusEnum")\
rename("ParameterDirectionEnum","newParameterDirectionEnum")
msado15.dll 这个dll 为什么用#import来导入啊??? 现在看看以前的代码, 发现没有彻底搞懂。。。。。。 调用dll,,不是这样的 啊
也没有头文件,不知道控制台程序能不能访问????
第二个问题:
由于我需要封装一个类,这个类的功能就是: 实现 调用存储过程的类。。。。。。
由于调用存储过程太的繁琐了。。。。 希望用一个类进行封装,
这样,不了解ado的人,也会使用,简单
谁封装过。。。。
有的话,贡献代码,谢谢了啊
------解决方案--------------------
首先发下msdn关于预编译指令#import的解释:
The #import directive is used to incorporate information from a type library. The content of the type library is converted into C++ classes, mostly describing the COM interfaces.
在编译时,vc++会读出msado15.dll类型库信息,自动产生两个该类型库的头文件和实现文件msado15.tlh和msado15.tli(在您的Debug或Release目录下)。在这两个文件里定义了ADO的所有对象和方法,以及一些枚举型的常量等。
所以不用担心没有包含头文件。
#import "C:\program files\common files\System\ado\msado15.dll" no_namespace \
rename("EOF","EndOfFile") \
rename("LockTypeEnum","newLockTypeEnum")\
rename("DataTypeEnum","newDataTypeEnum")\
rename("FieldAttributeEnum","newFieldAttributeEnum")\
rename("EditModeEnum","newEditModeEnum")\
rename("RecordStatusEnum","newRecordStatusEnum")\
rename("ParameterDirectionEnum","newParameterDirectionEnum")
msado15.dll 这个dll 为什么用#import来导入啊??? 现在看看以前的代码, 发现没有彻底搞懂。。。。。。 调用dll,,不是这样的 啊
也没有头文件,不知道控制台程序能不能访问????
第二个问题:
由于我需要封装一个类,这个类的功能就是: 实现 调用存储过程的类。。。。。。
由于调用存储过程太的繁琐了。。。。 希望用一个类进行封装,
这样,不了解ado的人,也会使用,简单
谁封装过。。。。
有的话,贡献代码,谢谢了啊
------解决方案--------------------
首先发下msdn关于预编译指令#import的解释:
The #import directive is used to incorporate information from a type library. The content of the type library is converted into C++ classes, mostly describing the COM interfaces.
在编译时,vc++会读出msado15.dll类型库信息,自动产生两个该类型库的头文件和实现文件msado15.tlh和msado15.tli(在您的Debug或Release目录下)。在这两个文件里定义了ADO的所有对象和方法,以及一些枚举型的常量等。
所以不用担心没有包含头文件。