感谢楼主上次的及时答复,问题已得到很好的解决。
现在编程时又遇到这样的问题,实不知是哪方面出错了?望请指教。
代码如下:
uint16 str[20] = {0};
uint16 Length = 0;
if(open_ps(1,0)) (注:open_ps()与read_ps()二函数是产品中的内部函数)
{
if(read_ps(706,str,15,&Length))
{
showver.Format("%4x%4x%4x%4x%4x%4x%4x%4x%4x%4x%4x%4x%4x%4x%4x",str[0],str[1],str[2],str[3],str[4],str[5],str[6],str[7],str[8],str[9],str[10],str[11],str[12],str[13],str[14]);
::SetWindowText(::GetDlgItem(AfxGetMainWnd()->m_hWnd,IDC_EDIT1),showver);
}
else
{
AfxMessageBox("读取键失败");
}
}
else
{
AfxMessageBox("打开键失败");
}
调试后,显示错误信息:
error LNK2001: unresolved external symbol _read_ps@16
error LNK2001: unresolved external symbol _open_ps@8
Debug/E0715.exe: fatal error LNK1120:2 unresolved externals
我把数组str的声明改为uint32 str[15]={0};调试后结果仅有一个错误出现:
error C2664:"read_ps":cannot convert parameter 2 from "unsigned int[15]" to "unsigned short *const"types
pointed to are unrelated;conversion requires reinterpret_cast , C-Style cast or function-style cast.
注:函数open_ps()与read_ps()均是产品中的内部函数,执行一定的功能:
(1)open_ps()是完成打开ps键的功能。
(2)read_ps(const unsigned short key,unsigned short *const data,const unsigned short maxlen,unsigned short *const len)
parameters: key-->the ps key entry id
data-->pointed to array to recieve the ps data to be read
maxlen-->the size of the data array
len-->the acrual size of the read key
function: the function is used to write to the persistent store.