在参数可选框里找不到string类型的,我自己把它填到里面去,焦点离开后变成了BSTR,不知是不是这种类型。
另外,在选择返回值类型时,也有相同的情况,但我依照上面的方法操作,焦点离开后却可以保持String!更奇怪的是,照如上方法操作完毕,实际上在代码中参数是WideString类型(满足要求),而返回值却对应HResult类型的,这个HResult究竟是什么类型呢?
请高人指点迷津。

解决方案 »

  1.   

    环境:在ActiveX Library里新增一个Com Object。
                新增的方法是先在type library的面板里加入,然后在代码里细化的。
      

  2.   

    在程序里试过了,HResult不是string类型的。请指点。
      

  3.   

    请问hresult又是什么类型的呢?
      

  4.   

    hresult  这好像是一个整型,在类型库中BSTR就是wideString类型,在Delphi中String 与 WideString是兼容的,不必转换。
      

  5.   

      测试了一下,HResult的确是一个整形,10位的,与delphi现有的simple类型的都不相同,具体大小没测,知道的朋友指点一下。  
      谢谢“周”及老达摩、严黎斌,以上已解决了我的问题,分数一定会给的,但这个帖子我暂时不想结,希望能补充的朋友补充一下,有能力的朋友还请帮忙回答:
       http://www.csdn.net/expert/topic/418/418251.shtm(就是今天的)
                     再次感谢。
      

  6.   

    hresult就是 LongInt型
    是Com函数返回值,最高位为0则成功,否则失败,还有其他各位都代表一定的含义
    对于自己调用如成功Result := S_OK
    拷的帮助
    An HRESULT is made up of a 1-bit severity flag, an 11-bit handle, a 4-bit facility code indicating status code (SCODE) group, and a 16-bit SCODE information code. A value of zero for the severity flag indicates the success of the operation for which the HRESULT was returned.
    A HRESULT type returned as an error code for a function can provide the application that called the function information on the error and how to recover from it. To obtain this information, the application uses the handle of the HRESULT. The HRESULT and SCODE types are not equivalent. OLE includes functions and macros to convert between error codes of these two types. To create an HRESULT code from an SCODE code, use ResultFromScode(SCODE). To convert an SCODE code to HRESULT form, use GetScode(HRESULT). For details about ResultFromScode and GetScode and for faster ways of making the conversions just mentioned, see OLE Programmer's Reference, Volume One. . For a description of the OLE implementation of HRESULT, see Inside OLE, Second Edition, by Kraig Brockschmidt.