Skip to main content
GameDev.net gamedev.net
🔒 Locked

COM vs. DLL/C++ wrapper vs. ?

Started by WoolyLoach Jul 17, 2003 at 12:30 PM 5 replies 4.2k views
Original Post
WoolyLoach
WoolyLoach
Ok, after a LONG break from game development, the embedded stuff at the office has begun to bore me.. so back into gamedev I go.. pity me. I''m looking at implementing my game as a set of DLLs bound together by the main application (doh). Having forgotten most of my Windows programming stuff (been doing pSOS and vxWorks) I''m wondering what the best approach would be to creating the various modules in the system: COM objects, or C++ classes that wrapper DLLs written in straight C? I''ve read the MSDN and tech articles, so I know HOW to do either one, I''m just wondering if anyone has experience implementing same and can make a recommendation as to which method is easiest to implement and test? TIA for any help, until then, back to reading MSDN.. :-/
Wooly Games for Wooly Minds!
felisandria
felisandria
Technically if you''re using DirectX you''re using COM. But, there''s no real reason for you personally to also use COM unless you intend to someday release an SDK of your stuff with severe concern for hiding your actual code.

I''d say go C++. There''s enough COM work in the DirectX itself, you shouldn''t be doing something so odd that you would need the ability to completely remove it from all other things, as all the driver work, etc, is done by DX.

-fel
~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~
antareus
antareus
I don''t see why you can''t write the DLLs in C++.

I don''t know much about COM, but it looks like MS''s first attempt to make the languages all equally capable. As such, I don''t see why you''d want that necessarily in a game, because the languages AREN''T equal.
--God has paid us the intolerable compliment of loving us, in the deepest, most tragic, most inexorable sense.- C.S. Lewis
WoolyLoach
WoolyLoach
Well, my main concept was to hide most of the implementation details in external files compiled into DLLs, but exporting C++ classes from DLLs looks a tad dodgy - plus there are apparently Issues(tm) if you do that and then want to expose the functionality to Visual BASIC or C#. Using COM would allow me to shove stuff in DLLs and let the stuff I write also be called from other languages.. with some additional development cost, of course.

If I were to only use C++, not care about alternate languages, etc. then I could go ahead and shove my classes in DLLs and export ''em wholesale, but I was wondering if there were a better/easier/more robust/more flexible way.

I think I''ll just fire up the compiler and experiment. Thanks for the info.
Wooly Games for Wooly Minds!
Nypyren
Nypyren
The .NET version of COM stuff makes it ridiculously easy to write plug-in systems (I kid you not, it''s like 10 lines of code on the client side, and AUTOMATIC on the server side)

(where server = plugin, client = app)
flangazor
flangazor
.Net doesn't install on win98 se so I am stuck using ATL or writing COM out by hand :-(

[edited by - flangazor on July 18, 2003 4:58:06 AM]
jesterlecodeur
jesterlecodeur
I personaly rewrite a COM-like system, but more lightweight (not using registry) and crossplatform.

Look at http://xplc.sourceforge.net/ there a good COM-like system.
_______________
Jester, studient programmerThe Jester Home in French

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.