关于回调函数CALLBACK
我这里有一个VC的lib文件,里面用到回调函数,但我用BCB时操作不成功,麻烦大家看下:
下面是VC的程序
bool CALLBACK CVideoDlg::SearchIP(int index, IPCINFO *pIPNode)
{
char ip[16] = {0};
char mac[32] = {0};
sprintf(ip, "%d.%d.%d.%d", pIPNode->ip[0], pIPNode->ip[1], pIPNode->ip[2], pIPNode->ip[3]);
sprintf(mac, "%02x.%02x.%02x.%02x.%02x.%02x", pIPNode->mac[0], pIPNode->mac[1], pIPNode->mac[2], pIPNode->mac[3], pIPNode->mac[4], pIPNode->mac[5]);
printf("index = %d ip = %s mac = %s\n", index, ip, mac);
g_VideoDlg.InsertIntoList(g_VideoDlg.m_listIP, index, ip, mac);
memcpy(&(g_VideoDlg.m_pIPNode[index]), pIPNode, sizeof(IPCINFO));
return true;
}
WAPA_IPC_SetSearchIPCallBack(SearchIP);//这里调用
我在bcb中这样写
bool CALLBACK SearchIP(int index, IPCINFO * pIPNode)
{
char ip[16] = {0};
char mac[32] = {0};
sprintf(ip, "%d.%d.%d.%d", pIPNode->ip[0], pIPNode->ip[1], pIPNode->ip[2], pIPNode->ip[3]);
sprintf(mac, "%02x.%02x.%02x.%02x.%02x.%02x", pIPNode->mac[0], pIPNode->mac[1], pIPNode->mac[2], pIPNode->mac[3], pIPNode->mac[4], pIPNode->mac[5]);
printf("index = %d ip = %s mac = %s\n", index, ip, mac);
//g_VideoDlg.InsertIntoList(g_VideoDlg.m_listIP, index, ip, mac);
//
//memcpy(&(g_VideoDlg.m_pIPNode[index]), pIPNode, sizeof(IPCINFO));
return true;
}
WAPA_IPC_SetSearchIPCallBack(SearchIP);
提示
[Linker Error] Unresolved external '_WAPA_IPC_SetSearchIPCallBack' referenced from D:\CAMERA\MAIN.OBJ
请问这是什么问题?我已经把VC下的dll用implib生成bcb下的lib文件
[解决办法]
把用implib生成bcb下的lib文件加入到你的Project中。
[解决办法]
解决了恭喜.