RE: [GD-General] Multiple Inheritance and RTTI
Brought to you by:
vexxed72
From: Donavon K. <kei...@ea...> - 2003-02-11 01:18:07
|
<sigh> Saying that it's "utterly pointless" was just really uncalled for on my part. I've been reading too much Usenet lately. Now, with my hyperbole filter properly reseated... I don't say that ATL must be used, but I wouldn't want to preclude it either. And it just seems to me that COM compliance leaves open a lot of interesting interop and remoting scenarios. These days I'd be leaning towards .NET interop. Like maybe writing unit tests in C#. The results could be logged to a database, it could fire off an e-mail, the tests could be remotely managed, etc. It's not that you couldn't do these things by other means, but in .NET, interop with COM is pretty painless and these sorts of things are so easy it's almost fun. When features are easy to implement, you tend to have them. One client-server game I was on used COM interfaces with a custom remoting layer for communication. This enabled us to run the client and server across the Net or in the same process, talking directly over their vtables, and for the most part it just worked. The proxy and stub classes were custom but still auto-generated from type info, which streamlined things a lot -- just change the IDL and update the implementers and everything else is automatic. We also used this for remote management of the server. But -- we used COM only for things we needed to expose or thought we might expose in the future, like for testing. I'd love to do something similar with a single-player game/client. Say you're playing the game and you see something anomalous, so with the game running you pop up some IM-like thing and ping your teammate who may be on VPN, and for them the IM-like thing shows what's basically a management console. In one pane they see a screenshot updated every second or so, and in the same UI they can poke around in the game state, maybe remotely control the game, and so on. The applications for QA are obvious. Donavon P.S. IIRC, you don't need IDispatch as of VB6, but you would need a typelib, and VB has some pretty severe type restrictions. > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...] On Behalf Of > Paul Bleisch > Sent: Monday, February 10, 2003 1:27 PM > To: gam...@li... > Subject: RE: [GD-General] Multiple Inheritance and RTTI > > > 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...] > > Sent: Monday, February 10, 2003 1:15 PM > > To: gam...@li... > > Subject: Re: [GD-General] Multiple Inheritance and RTTI > > > > > > There's a bit more to full COM interop than that, and in my > > opinion it > > mostly adds baggage that you don't want or need. For > > instance, all your > > methods need to return HRESULTs and the real results in out > > parameters > > (after all, you never know when that pesky DCOM marshaler is going to > > fail to connect to the IRenderer object running on some other machine > > :). Imagine having to change all function calls like > > "interface->GetCountOfSomething()" to > > > > int count; > > HRESULT hr; > > hr = interface->GetCountOfSomething(&count); > > if (SUCCEEDED(hr) { > > ... > > > > Blech. > > > > You would also want to define your interfaces in MS IDL to generate > > typelibs for IDispatch (which Visual Basic would need). By > > contrast the > > approaches discussed here wouldn't even require a windows box > > to compile > > IDL files on, just straight C++. > > > > So it might have been pointless, but not <i>utterly</i> > > pointless :). > > > > --brian > > > > Donavon Keithley wrote: > > > > >Instantiating a class by some means other than > > 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 > > rest of the > > >COM world. Implement a typelib and adhere to some basic > > 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 > > redefine IUnknown. > > >They called it "IUnknown", it had QI, AddRef, and Release, > > but IIDs were > > >strings, not GUIDs. So their "custom" COM system looked > > 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 > > of classes, > > >they instead had to redefine their own macros and template classes. > > > > > >It was an utterly pointless exercise in NIH. > > > > > >Donavon > > > > > > > > > > > >>-----Original Message----- > > >>From: gam...@li... > > >>[mailto:gam...@li...] > > 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 > > 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 > > >> > > >> > > >works > > > > > > > > >>nice with QueryInterface because you might have a few interfaces to > > >> > > >> > > >the > > > > > > > > >>same > > >>object ). > > >> > > >>Again, Inside COM is a must read if you plan on having a COM like > > >> > > >> > > >system. > > > > > > > > >>>-----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 > > >>> > > >>> > > > > > > > > ------------------------------------------------------- > > This SF.NET email is sponsored by: > > SourceForge Enterprise Edition + IBM + LinuxWorld = 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=557 > > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld > 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_idU7 |