vc头文件中声明的调用函数是
   DLLEXPORT_API int __stdcall RegisterDrawFun(DWORD nport, DRAWFUN(DrawFun),LONG nUser);
   程序中回调函数为
void CALLBACK DrawFun(long nport, HDC hDc,LONG nUser)
{
CHKVisionDlg *pOwner = (CHKVisionDlg*)nUser;
if (nport == iLastSelect  ) //&& DisplayMode != 1)
{
if (DisplayMode != 1)
{
int weight,height;
weight = rectList[iLastSelect].right - rectList[iLastSelect].left;
height = rectList[iLastSelect].bottom- rectList[iLastSelect].top;
HGDIOBJ pOldPen = ::SelectObject(hDc,&penWhite);
::MoveToEx(hDc, 1,  1, NULL);
::LineTo(hDc, weight -1, 1);
::LineTo(hDc, weight -1,height-1);
::LineTo(hDc, 1,height -1);
::LineTo(hDc, 1,1);
::SelectObject(hDc,pOldPen);
}
CString str;
str.Format("channel%d",nport);
SetTextColor(hDc, RGB(255,0,0));
SetBkMode(hDc,TRANSPARENT);
TextOut(hDc,10,10,str,str.GetLength()); if(pOwner->m_bMoving[nport])
{
pOwner->m_VideoWin.DrawVect(nport,(char *)motionData[nport],hDc,pOwner->chstandard[nport]);
pOwner->m_bMoving[nport] = FALSE;
}
}
else
pOwner->StopDrawFun(nport);
return;}
   这是一个视频卡的注册画图回调函数,下面是文件说明
       :int RegisterDrawFun(DWORD nport,DRAWFUN(DrawFun),LONG nUser) 
      参数: DWORD nport  通道号索引 
             DRAWFUN(DrawFun) 回调函数句柄
             Long  nUser  用户数据
   回调函数说明  void CALLBACK DrawFun(Long nPort,HDC hDC,Long nUser)
                nPort 通道号
                hDc   OFFSCREEN表面上下文,相当于窗口DC
                nUser 用户数据  这些函数在delphi中怎么写。另外,怎么把vc头文件直接转换成delphi,有什么工具吗

解决方案 »

  1.   

    搜索headconv吧!很不错的软件,可以少写不少代码,但是你这个问题用这个软件还搞不定,我也正遇到了这个问题,一起研究吧!呵呵!
      

  2.   

    type TReadCallBack = procedure(pPacketBuffer:pbyte;nPacketSize:cardinal);stdcall;
    function VS_MP4_ClientGetFileByName(m_lAddrIP:pchar;m_cFilename:pchar;m_hFileEndEvent:THandle;m_hSetPosEvent:THandle;m_cPos:pchar;ReadCallBack:TReadCallBack;dserverport:word):integer;stdcall;
    这样可以!!我搞定了