Skip to content

Instantly share code, notes, and snippets.

@82488059
Created September 2, 2013 05:34
Show Gist options
  • Save 82488059/6409498 to your computer and use it in GitHub Desktop.
Save 82488059/6409498 to your computer and use it in GitHub Desktop.
CString szStr(_T("Provider=SQLOLEDB.1;SERVER=192.168.0.121;UID=sa;PWD=12345;DATABASE=jinhe;"));
CString sKey = _T("z12345");
typedef CString (PASCAL EXPORT *BuildNcProgram)(const CString&, const CString&,const CString&);
HINSTANCE hDLL;
hDLL = LoadLibrary(_T("BuildNcProgram.dll"));
if (NULL != hDLL)
{
BuildNcProgram Building =(BuildNcProgram)GetProcAddress(hDLL, _T("BuildNcProgram"));
if (NULL != Building )
{
CString sss = Building(szStr, sKey, "E:\\");
MessageBox(sss);
}
else
{
CString ss = _T("取函数错误!");
}
FreeLibrary(hDLL);//卸载MyDll.dll文件;
}
else
{
_T("加载DLL错误!");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment