vc++ 6.0中如何调用带引用参数的dll
dll中的方法如下 a(string,string,ref string),在vc++ 6.0中如何调用? --------------------编程问答-------------------- HINSTANCE hDLL = 0; // Handle to DLLint (__stdcall *lpFunction) (char*,char *) = 0; //Pointer of the function to invoke
hDLL = LoadLibrary (".\\dll\\AAA.dll");
if (hDLL != NULL)
{
lpFunction = (int (__stdcall *) (_char*,char *))(GetProcAddress(hDLL, "GetDll"));
if (!lpFunction)
{
PrintSysErrMsg (GetLastError ());
}
else
{
lpFunction (username,password);
}
if (!FreeLibrary(hDLL))
{
PrintSysErrMsg (GetLastError ());
}
}
else
{
PrintSysErrMsg (GetLastError ());
}
AAA.dll项目中:
extern "C"
{
int __stdcall GetDll(char strUserName[32],char strPassword[32])
{
。。。。。。。。。。。。。。。。。。
}
}
说明:username,password两个为参数值
lpFunction = (int (__stdcall *) (_char*,char *))(GetProcAddress(hDLL, "GetDll"));中的GetDll为AAA.dll中的函数名。 --------------------编程问答-------------------- a(string,string,ref string),在vc++ 6.0中如何调用?
==============
这是c#的 vc6.0 无法直接引用,把c#的转为com
补充:.NET技术 , VC.NET