比如VC的DLL中有这么一个函数:
AFX_CLASS_EXPORT void _cdecl SetResultOutPut(void(*ResultOutPut)(CSearchFile*));在delphi中我
首先我定义了一个指针函数:
TResultOutPutFun = procedure(pParam:Pointer);
procedure SetOutPutFun(pParam:Pointer);然后实现
procedure SetOutPutFun(pParam:Pointer);
  begin
   ListviewCount:=SearchForm.LstVwKySrch.Items.Count;
   with SearchForm.LstVwKySrch do
   begin
       ListItem:=Items.Add;
       ListItem.Caption:=GetSourceName(pParam);
       ListItem.SubItems.Add(inttostr(GetSourceFileSize(pParam)));
       ListItem.SubItems.Add(inttostr(GetSourceCount(pParam)));
       ListItem.Data:=pParam;//保存这个指针.
//GetSourceName(),GetSourceFileSize(pParam),GetSourceCount(pParam) 也是VC dll中的函数.
   end;
  end;
再下来,SearchForm窗口中调用
var
    FunPoint:TResultOutPutFun;//定义成全局的procedure TSearchForm.Button1Click(Sender: TObject);
begin
 
  FunPoint:=SetOutPutFun;
  SetResultOutput(FunPoint);
  StartSearch(pEmuleMan,ComBoxKey.Text,CmbBxMb.ItemIndex,FlTpCmbBindex,true);
   
end;结果没有结果返回给我.
我单步断点调试过了.调用已经入到了ListItem:=Items.Add; 再下来调用VC dll中的函数GetSourceName(),GetSourceFileSize(pParam),GetSourceCount(pParam) 就不能通过了.我不知道是为什么这样子回调用不行?