#ifdef __cplusplus
extern "C"
{
#endiftypedef long (__stdcall *DATADETECTEDPROC)(const unsigned char *pData, unsigned long ulSize, void *pContext);
typedef struct _FN_CONTEXT
{
unsigned long ulFlags;
DATADETECTEDPROC pfnDataDetected;
void *pContext;
} FN_CONTEXT, *PFN_CONTEXT;
typedef const FN_CONTEXT *PCFN_CONTEXT;long __stdcall InitCommContext(PCFN_CONTEXT pContext);
long __stdcall ExitCommContext();#ifdef __cplusplus
}
#endif

解决方案 »

  1.   

    Delphi没有typedef,但是却有一个type [section]
    type {section name}
    newtypename=oldtypename; {define values here}
      

  2.   

    翻译部分代码:type
      DATADETECTEDPROC = function (const pData: PByte; ulSize: DWORD;
        pContext: Pointer): LongWord of Object;  _PFN_CONTEXT = ^_FN_CONTEXT;
      _FN_CONTEXT = record
        ulFlags: DWORD;
        pfnDataDetected: DATADETECTEDPROC;
        pContext: Pointer;
      end;
      

  3.   

    大至如下:
    type
      DATADETECTEDPROC=function(const pData:pbyte ;ulSize:dword;pContext:pointer):integer;stdcall;
     FN_CONTEXT = record
    ulFlags:dword;
    pfnDataDetected:DATADETECTEDPROC ;
    pContext:pointer;
    end;
    PFN_CONTEXT=^FN_CONTEXT;
    PCFN_CONTEXT= ^FN_CONTEXT ;function InitCommContext(pContext:PCFN_CONTEXT ):integer;stdcall;
    function ExitCommContext():integer;stdcall;