标签:catch dll import for name dialog cstring files code
VS2012
1、初始化ADO
//hpp头文件里导入ADO //导入ADO动态链接库 #import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF", "adoEOF") //cpp文件OnInitDialog()里初始化ADO //初始化ADO HRESULT hr; try { hr = CoInitialize(NULL); //检查初始化是否成功 if (SUCCEEDED(hr)) { AfxMessageBox("初始化ADO COM成功!"); } else { AfxMessageBox("初始化ADO COM失败!"); } } catch (_com_error e) { CString errormessage; errormessage.Format("%s"), e.ErrorMessage(); AfxMessageBox(errormessage); }
标签:catch dll import for name dialog cstring files code
原文地址:https://www.cnblogs.com/nxopen2018/p/14253001.html