|
|
|
date: 15 Nov 2005 14:05:06 GMT,
group: microsoft.public.platformsdk.com_ole
back
Re: Is it possible to decide at run-time which interface a coclass supports?
If I understand correct, Microsoft discourage such implementation, but,
certainly, if the client application is awair of such behaviour it might be
Ok.
Additional point in my message was that usually Visual Basic clients do not
handle HRESULT values other then S_OK. It requires On Error GoTo ...
handling. That is why if you want to design something for use in Visual
Basic it is better to implement functions that always return S_OK and
provide error information in other ways.
And one more thing. If I remember correct, Visual Basic does not use
IUnknown::QueryInterface. It uses IDispatch::Invoke to call methods and
properties.
"Stefan Ensslen" wrote in message
news:437B4F66.30249223@web.de...
> Max wrote:
>>
>> The set of interfaces accessible on an object through
>> IUnknown::QueryInterface must be static, not dynamic. This means that if
>> a
>> call to QueryInterface for a pointer to a specified interface succeeds
>> the
>> first time, it must succeed again, and if it fails the first time, it
>> must
>> fail on all subsequent queries.
>
> Perhaps my posting was a bit confusing: I want that instances from my
> coclass can decide at run-time which interfaces to export. That means
> when asked by QueryInterface each instance will perform some checks (for
> example if the camera is connected to the right kind of framegrabber)
> and reject or satisfy the interface request. Once it has decided to give
> out one sort of interface pointers it will do so in future requests.
> Another instance of the same coclass my decide never to export this
> interface.
date: Thu, 17 Nov 2005 11:40:11 +0200
author: Max please@newsgroup
|
|