Re: is CArray<CComPtr<IUnknown>, CComPtr<IUnknown>&> possible?



"JD" <jdt_young@xxxxxxxxx> schrieb im Newsbeitrag
news:O6leaq24GHA.1460@xxxxxxxxxxxxxxxxxxxxxxx
Hi,

I want to have a declaration as follows:

CArray<CComPtr<IUnknown>, CComPtr<IUnknown>&> a;

But VC++ 6.0 gives me a compile error:

cannot convert parameter 1 from 'struct IUnknown ** ' to 'class
ATL::CComPtr<struct IUnknown> *'

The reason is that there is a ATL function requires a parameter of address
of CComPtr<IUnknown>, but the operator & of CComPtr<IUnknown> returns
IUnknown* and hence &CComPtr<IUnknown> returns IUnknown**.

Do you know how to resolve this problem? Thanks for any help.

Tony

Try CAdapt< CComPtr< IUnknown > >

Heinz


.



Relevant Pages

  • is CArray, CComPtr&> possible?
    ... I want to have a declaration as follows: ... But VC++ 6.0 gives me a compile error: ... The reason is that there is a ATL function requires a parameter of address of CComPtr, but the operator & of CComPtr ...
    (microsoft.public.vc.mfc)
  • Re: CStringArray.add problem
    ... but the obvious reason for this compile error ... is that the declaration says sizeToal and the calling routine uses sizeTotal ...
    (microsoft.public.vc.mfc)
  • Re: Properties
    ... public string Name ... The fact of the matter is that by adding having to add a field declaration ... There is no reason that you have given why this cannot be done. ... property but where theres a property theres a field and hence theres no ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: identifiers and modules
    ... Do you have a reason why a language should allow it? ... (let ((foo (transform-value foo))) ...)) ... working on a large nested function can easily use the wrong variable ... Given that allowing an inner declaration to override an outer ...
    (comp.lang.scheme)
  • Re: [SLE] Error installing IPTables::IPv4 - SOLVED
    ... > following compile error: ... > Many countries have at least one CPAN site already. ... > this definition or declaration, which is probably not what you want ...
    (SuSE)