Re: breaking change in uuid attribute?
- From: "Igor Tandetnik" <itandetnik@xxxxxxxx>
- Date: Wed, 2 Nov 2005 08:09:40 -0500
"Egbert Nierop (MVP for IIS)" <egbert_nierop@xxxxxxxxxxxxxx> wrote in
message news:OIiuu233FHA.1420@xxxxxxxxxxxxxxxxxxxx
> "Igor Tandetnik" <itandetnik@xxxxxxxx> wrote in message
> news:%23NepcOx3FHA.3844@xxxxxxxxxxxxxxxxxxxxxxx
>> Your code omitted [id] attributes on properties and methods, that's
>> why attribute provider fell back on IDispatchImpl. With your code
>> and [id] attributes in place, it does produce "hand-made IDispatch".
>
> a ha!
> so there is also an ID attribute on a method? I didn't know.
>
> Honestly, I find that bad programming.
Find what bad programming?
> The ID's should be (according to COM rules) on the COM interface, and
> not on the STDMETHODIMP's
Of course. You seem to imply I somehow suggested otherwise. I don't
recall such an event.
In case you haven't followed that other thread for some reason, here is
my example again:
// IBlah
[
object,
uuid("2FE92314-B919-4A34-828B-B15807EAFB5E"),
dual, helpstring("IBlah Interface"),
pointer_default(unique)
]
__interface IBlah : IDispatch
{
[id(1)]
HRESULT Method();
};
// NWCSession
[
coclass,
threading("both"),
support_error_info("IBlah"),
aggregatable(type=allowed),
version(4.0),
uuid("B65355A8-4F40-4875-91B6-72B99B2B18D9"),
vi_progid("Prog.Component"),
progid("Prog.Component.1"),
helpstring("NWCSession Class")
]
class ATL_NO_VTABLE NWCSession :
public IBlah,
{
public:
NWCSession()
{
}
DECLARE_PROTECT_FINAL_CONSTRUCT()
HRESULT FinalConstruct()
{
return S_OK;
}
void FinalRelease()
{
}
public:
STDMETHODIMP Method() {return S_OK;}
};
> I do have some methods with defined IDs.
Try having _all_ methods with defined IDs.
> We can be certain that your problem exists, but really, in rare
> circumstances, the bug is 'triggered'.
Is it so unusual to have ids explicitly assigned to all methods of a
disp- or dual interface? I submit it is actually a preferred way of
doing it, rather than having MIDL assign random ids.
> I still like attributes, they way the should be, not the way MS deals
> with them.
I don't like the idea of attributes for COM programming, even if they
were completely bug-free, for reasons stated by Alexander Nickolov here:
http://groups.google.com/group/microsoft.public.vc.atl/browse_frm/thread/88d152124465c1d2/2c2ee80926c7628c
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
.
- Follow-Ups:
- Re: breaking change in uuid attribute?
- From: Egbert Nierop \(MVP for IIS\)
- Re: breaking change in uuid attribute?
- References:
- Re: breaking change in uuid attribute?
- From: Egbert Nierop \(MVP for IIS\)
- Re: breaking change in uuid attribute?
- From: Igor Tandetnik
- Re: breaking change in uuid attribute?
- From: Egbert Nierop \(MVP for IIS\)
- Re: breaking change in uuid attribute?
- From: Igor Tandetnik
- Re: breaking change in uuid attribute?
- From: Egbert Nierop \(MVP for IIS\)
- Re: breaking change in uuid attribute?
- Prev by Date: Re: Caching a COM pointer in ATL server
- Next by Date: Re: initialize a data member which is a reference to a struct
- Previous by thread: Re: breaking change in uuid attribute?
- Next by thread: Re: breaking change in uuid attribute?
- Index(es):
Relevant Pages
|