IDispatchProxy and [out] parameters



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)


.



Relevant Pages

  • Re: Fronten/Backend
    ... Dim wa As Long, wb As Long, wc As Integer, wd As Long, we As String, wf As ... Dim rStromverbr As Long, rEURWVerbr As Currency, rWasserverbr As Long, ... rWasservorauszlg As Currency ...
    (microsoft.public.de.access)
  • Re: Reading IE browser contents?
    ... The Document object represents the loaded page. ... "Microsoft Shell Controls and Automation" ... Dim ie2 As InternetExplorer ... windows AND IE windows. ...
    (microsoft.public.vb.general.discussion)
  • Re: AND Operator and Currency data type
    ... dblPRMValue) to Currency whose memory-representation ... Dim lngLoWord As Long, lngHiWord As Long, lngValue As Long ... Dim recCSResult As recUDCurrencyStructure ... LSet recDLLeftExpression = recCSLeftExpression ...
    (microsoft.public.vb.general.discussion)
  • Re: function PlaySound does not work
    ... You need to use any of several methods to get the Windows directory. ... Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long ... Public Function GetWinDir() As String ... Dim sBuffer As String ...
    (microsoft.public.vb.winapi)
  • Re: How can I time the speed of a macro?
    ... Do you have the class module in the same workbook, ... lpPerformanceCount As Currency) As Long ... Dim cFrequency As Currency ... Private Sub Class_Initialize ...
    (microsoft.public.excel.programming)