Wince6.0+VS2005 环境下,运行程序,出现 error LNK2019:无法解析的外部符号 OleLoadPicture,该函数在XXXXX中引用
fatal error LNK1120:1个无法解析的外部命令
可能出现的原因是什么呢?求助各位大神
以下是代码:
DataPacket date;
Other other;
Photo photo;
Finger finger;
//定义缓冲区
char buffer[BUFFER_SIZE];
//接收数据
int nReceived = m_pSocket->Receive(buffer,BUFFER_SIZE,0);
memcpy(&date,buffer,sizeof(date));
//char string[32];
//AfxMessageBox(itoa(nReceived,string,10));
//Other the ;
//memcpy(&the,buffer,sizeof(buffer));
//buffer[nReceived] = 0;
int count = date.count;
other = date.other;
photo = date.photo;
finger = date.finger;
//将数据在列表框中显示出来
CString str1;
str1.Format("%s",other.Name);
m_ctrlMsgs.AddString(str1);
CString str2;
str2.Format("%s",other.SFZ);
m_ctrlMsgs.AddString(str2);
CString str3;
str3.Format("%s",other.CarType);
m_ctrlMsgs.AddString(str3);
CWnd *pWnd=GetDlgItem(IDC_PB);//获得pictrue控件窗口的句柄
CRect rect;
pWnd->GetClientRect(&rect); //获得pictrue控件所在的举行区域
CDC *pDC = pWnd->GetDC();
int photoByte = photo.len;
int fingerByte = finger.len;
HGLOBAL hGlob = GlobalAlloc(GMEM_FIXED, photoByte);
memcpy(hGlob,photo.szBuffer,photoByte);
CComPtr<IStream> spStream;
CreateStreamOnHGlobal(hGlob,TRUE,&spStream);
IPicture *pPicture;
OleLoadPicture(spStream,photoByte,TRUE,IID_IPicture,(void**)&pPicture);
OLE_XSIZE_HIMETRIC hmWidth;
OLE_XSIZE_HIMETRIC hmHeight;
pPicture->get_Width(&hmWidth);//获得图象真实宽度
pPicture->get_Height(&hmHeight);//获得图象真实高度
pPicture->Render(*pDC,0,0,rect.Width(),rect.Height(),0,hmHeight,hmWidth,-hmHeight,NULL);
pPicture->Release();
spStream.Release();
------解决思路----------------------
一般加载图片的函数,还是有的,如: SHLoadDIBitmap,只不过没有 OleLoadPicture 功能强大
自己可以在网上多查找一下