我一直想把a(bǔ)do封裝在一個dll中,看到一般常用的在stdafx。h中加入
這樣的一句,
#import "c:\program files\common files\system\ado\msado15.dll"no_namespaces
rename("EOF" adoEOF")
如果在mfc中生成的dll中也添加這一句,將不會編譯通過,有很多命名錯誤,可以改成如下的導(dǎo)入
#pragma warning(disable:4146)
#import "c:\program files\common
files\system\ado\msado15.dll" named_guids rename("EOF","adoEOF"),
rename("BOF","adoBOF")
#pragma warning(default:4146)
即可通過,然后和一般在mfc主程序調(diào)用ado一樣。