大学没有学好,用的有少最近遇到了,请高手指教一个dll的接口函数是c的
BOOL   Get_sys_status (void)
int Get_host_cmd(char *which_scn,unsigned char *did,unsigned char *texts,int *len,int *types)前一个我用
function Get_sys_status(): boolean; external 'retdll.dll';
搞定了
后一个有指针,实在搞不懂了
有高手帮帮忙嘛

解决方案 »

  1.   

    有没有定义调用约定?c是cdecl
    function Get_sys_status(): boolean;cdecl; external 'retdll.dll'; function Get_host_cmd(which_scn:PCHAR; did:PWCHAR; texts:PWCHAR; len, types:PINT):integer;cdecl;external 'retdll.dll';
      

  2.   

    调用:var
      s:string;
      sw1, sw2 : widestring;
      iLen, iType, iRet : integer;
    begin
      iRet := Get_host_cmd(PCHAR(s), PWCHAR(sw1), PWCHAR(sw2), @iLen, @iType);
    end;
      

  3.   

    借贵宝地问个问题:cdecl和stdcall到底有什么不同?
      

  4.   

    是不是用c写的DLL函数必须用cdecl调用呢
      

  5.   

    用stdcall编译通过了结果运行还是出错
      

  6.   

    Get_host_cmd如果没有取数据就不会报错如果有数据需要PCHAR(s), PWCHAR(sw1), PWCHAR(sw2), @iLen, @iType返回就不行了
      

  7.   

    这是Vc的
    void CMYDPDLLDlg::OnTimer(UINT nIDEvent) 
    {
    // TODO: Add your message handler code here and/or call default
    char scr;
    int len;
    unsigned char did;
    unsigned char texts[2500];
    if(Get_host_cmd(&scr,&did,texts,&len,&m_type)>=0)
    {
    m_outscr=" ";
    m_did=did;
    m_outscr.SetAt(0,scr);
    m_len=len;
    m_textout=_T(texts);
    UpdateData(FALSE);
    }
    CDialog::OnTimer(nIDEvent);
    }