RE: [GD-General] Multiple Inheritance and RTTI
Brought to you by:
vexxed72
From: Paul B. <pa...@mi...> - 2003-02-10 19:27:30
|
It becomes slight less pointless when your platform changes and your new platform doesn't support COM (or the ATL headers don't compile on it properly). Not that that would happens often. Paul > -----Original Message----- > From: brian sharon [mailto:pud...@po...]=20 > Sent: Monday, February 10, 2003 1:15 PM > To: gam...@li... > Subject: Re: [GD-General] Multiple Inheritance and RTTI >=20 >=20 > There's a bit more to full COM interop than that, and in my=20 > opinion it=20 > mostly adds baggage that you don't want or need. For=20 > instance, all your=20 > methods need to return HRESULTs and the real results in out=20 > parameters=20 > (after all, you never know when that pesky DCOM marshaler is going to=20 > fail to connect to the IRenderer object running on some other machine=20 > :). Imagine having to change all function calls like=20 > "interface->GetCountOfSomething()" to >=20 > int count; > HRESULT hr; > hr =3D interface->GetCountOfSomething(&count); > if (SUCCEEDED(hr) { > ... >=20 > Blech. =20 >=20 > You would also want to define your interfaces in MS IDL to generate=20 > typelibs for IDispatch (which Visual Basic would need). By=20 > contrast the=20 > approaches discussed here wouldn't even require a windows box=20 > to compile=20 > IDL files on, just straight C++. =20 >=20 > So it might have been pointless, but not <i>utterly</i>=20 > pointless :). =20 >=20 > --brian >=20 > Donavon Keithley wrote: >=20 > >Instantiating a class by some means other than=20 > CoCreateInstance[Ex] is > >not re-implementing COM. Many, many standard COM objects are not > >co-creatable (if I remember the jargon correctly). Like... D3D, for > >instance. > > > >COM only has a few mandatory rules, like implementing IUnknown and > >adhering to certain QueryInterface semantics. It's not much of an > >imposition and it leaves you open to interoperating with the=20 > rest of the > >COM world. Implement a typelib and adhere to some basic=20 > type rules and > >your objects will be callable from Visual Basic and .NET. Implement > >IDispatch and you open your objects up to the scripting world. > > > >Just don't do what one company I know did, and that's=20 > redefine IUnknown. > >They called it "IUnknown", it had QI, AddRef, and Release,=20 > but IIDs were > >strings, not GUIDs. So their "custom" COM system looked=20 > just like COM, > >but it was totally incompatible. There was no possibility of interop > >and where they could have taken advantage of ATL's rich set=20 > of classes, > >they instead had to redefine their own macros and template classes. =20 > > > >It was an utterly pointless exercise in NIH. =20 > > > >Donavon > > > > =20 > > > >>-----Original Message----- > >>From: gam...@li... > >>[mailto:gam...@li...]=20 > On Behalf Of > >>Gareth Lewin > >>Sent: Thursday, February 06, 2003 4:31 AM > >>To: gam...@li... > >>Subject: RE: [GD-General] Multiple Inheritance and RTTI > >> > >>COM basics are extremly simple to implement. > >> > >>You really need a standard way to implement a "Give me this=20 > interface" > >>function. (QueryIterface) > >>A standard way of iding interfaces (GUIDs or FourCCs or whatever) > >>And a base interface that concreate class implements. (IUnknown) > >> > >>A lot of COM also uses Factories, Ref counting and sometimes smart > >>pointers. > >>They are not needed, but tend to fit well ( For example ref counting > >> =20 > >> > >works > > =20 > > > >>nice with QueryInterface because you might have a few interfaces to > >> =20 > >> > >the > > =20 > > > >>same > >>object ). > >> > >>Again, Inside COM is a must read if you plan on having a COM like > >> =20 > >> > >system. > > =20 > > > >>>-----Original Message----- > >>>From: gekido [mailto:mi...@ub...] > >>>Sent: 05 February 2003 21:30 > >>>To: gam...@li... > >>>Subject: Re: [GD-General] Multiple Inheritance and RTTI > >>> > >>> > >>>with this said, anyone know of any opensource projects > >>>implementing a base > >>>COM-style cross-platform & cross-compiler library out there? > >>> > >>>surely there must be someone that's done the hard part for us ;} > >>> > >>>just curious > >>> > >>>mike w > >>>www.uber-geek.ca > >>> =20 > >>> >=20 >=20 >=20 > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld =3D Something 2 See! > http://www.vasoftware.com > _______________________________________________ > Gamedevlists-general mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-general > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=3D557 >=20 |