在C ++中使用GetPorcAddress()时出错 [英] Error in using GetPorcAddress() in c++

查看:160
本文介绍了在C ++中使用GetPorcAddress()时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


在代码中:

Hi
In the code:

HINSTANCE hinDLL;
hinDLL = LoadLibrary((LPCWSTR("WinSCard.dll"));
if (hinDLL != 0)
    {
              context=(EstablishContext) GetProcAddress(hinDLL,"SCardEstablishContext");

              listreaders=(ListReaders) GetProcAddress(hinDLL,"SCardListReaders");

              sconnect=(Connect) GetProcAddress(hinDLL,"SCardConnect");

              }
else{
     cout<<"Library failed to load\n";
     }
}



m在hinDLL和上下文中获取值,但在listreader和sconnect中获取未定义的值.



m getting values in hinDLL and context but getting undefined values in listreaders and sconnect.
Does GetProcAddress allow its use like i have done??

推荐答案

是的,如果您正确使用函数名...

SCardListReadersSCardConnect具有窄字符和宽字符实现,分别为SCardListReadersA,SCardListReadersWSCardConnectA,SCardConnectW

使用depends.exe检查DLL
Yes it does - if you get the function name right ...

SCardListReaders and SCardConnect have both narrow and wide char implementations, SCardListReadersA,SCardListReadersW and SCardConnectA,SCardConnectW respectively

Use depends.exe to examine the DLL


这篇关于在C ++中使用GetPorcAddress()时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆