各位大神帮下忙,为什么我得到的是指针而不是值?
STDMETHODIMP Cgkztrw::PinReportPressed(char* cpKey,SHORT timeOut,BSTR* pwd,SHORT* val)
{
// TODO: 在此添加实现代码
HINSTANCE hDLL;//dll句柄
//HANDLE hCom;//串口句柄
pinReportPressed _rpwd;//声明函数指针
hDLL=LoadLibrary(L"ZT_EPP_API.dll");
ofstream fout;
fout.open("c:\\test.log",ios::app);
if(hDLL==NULL){
FreeLibrary(hDLL);
}else{
_rpwd=(pinReportPressed)GetProcAddress(hDLL,"ZT_EPP_PinReportPressed");
if(_rpwd!=NULL){
_rpwd(cpKey,timeOut);
fout<<"返回值的结果为:"<<*val<<".........password value..........."<<cpKey<<endl;
CComBSTR passwd=_com_util::ConvertStringToBSTR(cpKey);
pwd=&passwd;
fout<<"BSTR*的结果为:"<<pwd<<endl;
return S_OK;
}else{
fout<<"PinReportPressed函数指针为空!"<<endl;
}
}
return S_OK;
}
我的这段函数代码中,pwd的结果为什么是一个指针,而不是值?求各位大神帮帮忙解答下,谢谢了!