> See, HRESULT is a typedef for long. So on the VC COM server side, a long
> return value is the same as HRESULT.
>
> Now, on the VC COM client side, the COM wrapper genrated by
> #import uses the
> SUCCEEDED macro to test the method call, and if it's successful, it return
> S_OK. So if your long return value is positive, that piece returns S_OK.
I see. Makes sense.
>
> On the VB COM client side, VB runtime checks the return HRESULT (long)
> value, and if it indicates success (is positive) then no error gets
> reported.
>
> I hope this correctly deciphers what happened. If not, let me know.
I'm honestly not sure... I'm not happy that the two returned different
behaviour in that area, but should I be surprised? lol I'm happy to avoid
trying to return value but using an extra [out] param instead, so I'll stick
to this concept.
> Nice COM magic, isn't it? :-)
Sounds like Black Magic to me! Inconsistent behaviour between clients
depending on the language used {:v(
> Generally, it's not a good idea to return anything except than an HRESULT
> from a COM method. Don't try it, you will be bitten.
Yes, I'm just massaging out the teeth marks as we speak {;v)
--
Jason Teagle
[EMAIL PROTECTED]