RE: IDispatchProxy and [out] parameters
- From: Werner <Werner@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 30 Jun 2005 07:49:05 -0700
Hi Aaron,
You are right. Automation marshalling (sometimes also called type library
marshalling) is NOT supported under Windows CE.
So things like GetIdsOfNames and Invoke are not marshalled and therefore can
not be used. Instead you should access your interface methods directly
like (on desktop side)
IDeliveryPtr iDel;
HRESULT hr = iDel.CreateInstance(__uuidof(Delivery));
iDel->GetSummary(...);
Note:
1. smart pointers,_bstrt_t, _variant_t don't work either by default under
CE. However you can make it work if you implement some functions yourself and
copy some ATL code from desktop COM (_com_error, ...)
2. Note that your interface definition in the IDL should be outside the
LIBRARY statement. This way MIDL will create proxy/sub marshalling code, else
it will create Automation compatible marshalling (= predefined marshalling
code implemented in oleaut32.dll).
MS did not implement the automation marshaller in order to reduce code size
(as automation marshalling is a special case in general proxy/stub
marshalling anyway) But the whole world is used to the automation marshaller,
so that is a big disadvantage of this decision )-:
Luckely VB can work without IDispatch, but VBscript can't.
Also things like ISupportErrorInfo are marshalled through oleaut32.dll and
therefore will not work on Windows CE. The problem with VB is also if your
iterface method returns a HRESULT >0x200 (= your own error definitions). VB
will try to call ISupportErrorInfo, ITypeInfo and other stuff, but this will
not work either (as they are not implemented in oleaut32.dll and therefore
there exists no marshal code for it.)
If you avoid using IDispatch functionality and use standard proxy/stub
marshalling, DCOM will work on CE4.2. VB will work if you stick to early
binding and don't return your own error codes.
Werner
.
- References:
- IDispatchProxy and [out] parameters
- From: Aaron Lawrence
- IDispatchProxy and [out] parameters
- Prev by Date: how can I use the D-link 530 card to link platbuilder?
- Next by Date: SDK question
- Previous by thread: IDispatchProxy and [out] parameters
- Next by thread: How I download kernel on parallel port?
- Index(es):
Relevant Pages
|
|