Board index » delphi » OleAuto object vs. Com object question

OleAuto object vs. Com object question

I created a new object of "ActiveX Library" and then added a "COM Object"
what I'm trying to understand is
why when I add:

   1.  a method with a return type of HRESULT it builds a function instead
of a procedure
        i.e:     function foo: stdcall;

   2.  a method with a return type of HRESULT and a parameter of * variant
and modifier set to
        out, RetVal  it builds the following

        function foo (out parm1 : OleVariant) :  HRESULT; stdcall;

                                 I was expecting

        function foo () :  OleVariant ; stdcall;

If I had done this with an "Automation Object" I get the following, which is
what I expect.

     1.   procedure foo ()  : stdcall;
     2.   function foo () :  OleVariant : stdcall;

What am I doing wrong, or is this normal behavior?

Thanks in advance

 

Re:OleAuto object vs. Com object question


Quote
Doug Lewis wrote:
> If I had done this with an "Automation Object" I get the following, which
> is what I expect.

>      1.   procedure foo ()  : stdcall;
>      2.   function foo () :  OleVariant : stdcall;

> What am I doing wrong, or is this normal behavior?

I believe the difference is that the "COM Object"
doesn't implement ISupportErrorInfo, which is needed
by the safecall to return errors as exceptions instead
of just putting a value in HRESULT.  

Look up the safecall convention for more info.
It should tell you the minimum requirements
for using it.

--

"Only choice is an oxymoron."

Other Threads