IDispatchProxy and [out] parameters
- From: Aaron Lawrence <aaronlNO@xxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 01 Jul 2005 00:38:50 +1200
Hi all.
I have got a DCOM server running OK on WinCE 4.2 (custom device; currently a CEPC). The client is a Windows 2000 system. Proxy and stub are registered and working.
However it seems when we access objects via IDispatch, [out] parameters don't work - they are null on return. If we use early binding instead (test app VB or VC) then they work fine.
Now this is perhaps expected, since there are hints here and there that [out] parameters are not Automation-compliant. I couldn't find any definitive statement about this though, and MIDL doesn't warn. I've been searching Google and Groups a lot ... :)
The confusing thing is that the same thing does work when the server is on desktop windows.
Can anyone shed any light on this?
I'm guessing there is some cleverness in IDispatchProxy on desktop Windows - perhaps automatic type conversion? - that isn't in the CE version. (Or surely, the difference would have to be in the stub side...) Or perhaps it's just a bug.
Thanks.
Code snippets follow:
IDL:
[
object,
uuid(3623A817-1A62-11D1-9558-8C21D3000000),
dual,
helpstring("IDelivery Interface"),
pointer_default(unique)
]
interface IDelivery : IDispatch
{
...
[id(23), helpstring("method GetSummary")] HRESULT GetSummary(
[out] BSTR* pName ,
[out] CURRENCY* pVolume ,
[out] CURRENCY* pPrice ,
[out] CURRENCY* pValue ,
[out] short* pType );
...
} [
uuid(3623A818-1A62-11D1-9558-8C21D3000000),
helpstring("Delivery Class")
]
coclass Delivery
{
[default] interface IDelivery;
};
Example client code:
Dim Del As Object ' as Delivery works
Dim grade As String Dim Price As Currency Dim Value As Currency Dim Volume As Currency Dim DelType As Integer
... get a delivery object ...
Del.GetSummary grade, Volume, Price, Value, DelType
the values are all zeroes (null string in the case of grade)
.
- Follow-Ups:
- RE: IDispatchProxy and [out] parameters
- From: Werner
- RE: IDispatchProxy and [out] parameters
- Prev by Date: Re: Create bootable CF with application
- Next by Date: How I download kernel on parallel port?
- Previous by thread: About create a WinCE BSP
- Next by thread: RE: IDispatchProxy and [out] parameters
- Index(es):
Relevant Pages
|
|