VC6.0------
long CMyAcXCtrl::r5() 
{
  return 1222;
}Delphi------var
  Form1: TForm1;
  ret:WideString;
 
  ret:= myacx1.r6();

解决方案 »

  1.   

    I guess you write a COM server in VC, and use it in Delphi.
    HRESULT CMyAcXCtrl::r5(long* lret) 
    {
    *lret = 1222;
      return S_OK;
    }
      

  2.   

    如果我把返回值放在参数表中,运行结果是正确的,
       如: 
       void CMyAcxCtrl::f1(strTmp inStr,long reply) 
       { 
             .....
             reply:=122;
        }
       在delphi 下测试没问题.而一旦将采用以下方式:
       long CMyAcxCtrl::f1(strTmp inStr) 
       { 
             ...... 
             return 122;
        }   在delphi 下测试
       
      var
       ret:Longint;  (报歉,我上次写错了)
     
       ..........   ret:= myacx1.f1('111');
      
       结果不对;而且我试过其他类型的返回值都不对.
       束手无措.