// stdafx.cpp : 只包括标准包含文件的源文件 // testdb.pch 将作为预编译头 // stdafx.obj 将包含预编译类型信息 #include "stdafx.h" // TODO: 在 STDAFX.H 中 // 引用任何所需的附加头文件,而不是在此文件中引用 typedef DBPoolInterface* (*CREATEINSTANCE)( ); DBPoolInterface* CreateDBPoolInterface( ) { //加载动态库 HMODULE hDll = ( HMODULE )LoadLibrary("db.dll"); if ( hDll == NULL ) { CString strError = _T(""); strError.Format(_T("error = %d"), GetLastError()); AfxMessageBox(strError); return NULL; } CREATEINSTANCE CreaetInstance = (CREATEINSTANCE)GetProcAddress(hDll, "CreateODBCPoolInstance"); DBPoolInterface *pIDBPool = CreaetInstance(); return pIDBPool; }