Re: Can this be automation compatible?
- From: "Alexander Nickolov" <agnickolov@xxxxxxxx>
- Date: Thu, 21 Jul 2005 09:52:10 -0700
You are correct, this method is not Automation-compatible,
hence not permissible in a dual interface. It needs to be
rewritten with safe arrays. Alas, some people violate rules
left and right. In this case, the interface is probably marshaled
using a proxy/stub DLL (it cannot be marshaled via the type
library and the Automation marshaler). If done properly,
this interface should derive from IUnknown, not be marked
as dual, and it cannot be the Automation interface of an ActiveX
Control.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
"John Carlyle-Clarke" <john.cc@xxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:Xns969A74EF3AC2johncceuroplacercouk@xxxxxxxxxxxxxxx
> I'm looking at a question someone has asked in a Delphi forum, and I
> realise that I'm uncertain about some pretty fundamental aspects of
> OLE/COM.
>
> His question refers to using a third party control's interface. It
> looks to me like method cannot be automation compatible, and yet
> according to his question it's part of a dual interface.
>
> How can this be?
>
> I thought the only way to pass an array in an automation context was
> with a safearray. I can see that these calls would maybe work in a
> DLL, if the COM system allows passing of pointers at all. But this
> surely could not work across machine or process boundaries, as how
> would the marhsaller know how big the arrays are? Or am I missing
> something?
>
> Here is the function prototype in C++:
>
> IRmNvCtrlDvd::GetDvdVolumeInfo
> Returns information about the DVD Volume being played
>
> Syntax
>
> HRESULT GetDvdVolumeInfo (
> INT* lpTitles,
> WORD* *Chapters,
> UNSIGNED CHAR** Angles
> );
>
> Parameters
>
> lpTitles [out] Pointer to the number of titles in the DVD
> volume.
>
> Chapters [out] Pointer to an array of chapters per title. The
> array indexes to be considered go from 1 to the number of available
> titles. This parameter can be NULL if not required.
>
> Angles [out] Pointer to an array of angles per title. The
> array
> indexes to be considered go from 1 to the number of available
> titles. This parameter can be NULL if not required.
>
.
- References:
- Can this be automation compatible?
- From: John Carlyle-Clarke
- Can this be automation compatible?
- Prev by Date: Re: Error 0x80070005 while calling a method
- Next by Date: Simple IUnknown Example
- Previous by thread: Can this be automation compatible?
- Next by thread: Simple IUnknown Example
- Index(es):
Relevant Pages
|