admin管理员组文章数量:1431726
I want to do a simple performance experiment of using DAO with C++. I found this - (v=office.12)?redirectedfrom=MSDN - which seems to indicate I could do something like:
#import <C:\Program Files\Common Files\microsoft shared\OFFICE14\ACEDAO.DLL> rename( "EOF", "AdoNSEOF" )
_bstr_t bstrConnect = "C:\\temp\\test.accdb";
DAO::_DBEngine* pEngine = NULL;
CoInitialize(NULL);
HRESULT hr = CoCreateInstance(
__uuidof(DAO::DBEngine),
NULL,
CLSCTX_INPROC_SERVER,
IID_IDispatch,
(LPVOID*)&pEngine);
if (SUCCEEDED(hr) && pEngine)
{
// COM errors are handled by the C++ try/catch block.
try
{
DAO::DatabasePtr pDbPtr = NULL;
pDbPtr = pEngine->OpenDatabase(bstrConnect);
...
However it is failing on the call to OpenDatabase
with this error:
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
I am admittedly over my head at this point - I did one semester of c++ decades ago. Research seems to indicate this is a problem with the header files - but I didn't make any header files, Visual Studio auto-created them by simply doing a build with the #import
line in place. Is it still possible to get something like this to work?
本文标签: ms accessuse ACEDAO with Visual Studio c 2019Stack Overflow
版权声明:本文标题:ms access - use ACEDAO with Visual Studio c++ 2019 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745580827a2664611.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论