Recent Resources
-
GLSL 4.0: Discarding Fragments to Create a Perf...
-
GLSL 4.0: Using Subroutines to Select Shader Fu...
-
Building a Complete Board-based Puzzle Game wit...
-
JIRA: Programming Workflows
-
.NET Generics 4.0: Container Patterns and Best...
-
Raw Meat: Game Design Tips from Team Meat's...
-
Sedge: An Automated Error Reporting Tool
A Simple COM Tutorial
By Odin Jensen | Published Feb 02 2001 09:41 AM in General Programming
Download attached article resource
Download attached article resource
For a quick test run ComTest\Debug\ComTest.exe (Run Install Components.bat first!)
To Uninstall the components run Uninstall.bat
This simple COM tutorial just creates to fictive "renders" as COM objects and shows how to select a between different components that support the same interface.
Disclaimer: This has nothing to do with a real render. It's only a COM test.
Important: COM interfaces cannot change, or you must create a completely new interface and still retain the old one. (Like DirectX) As long as you don't alter the interface you can change the code to your heart's content without requiring a recompile of the client that uses the component. If two apps use the same component it's only loaded once and unloaded when all are done using it via refcounting.
API hint: If you have different components for each API, don't expose it to the outside world. That way a user of, say, the DirectX8 render will only need the runtime and not the SDK. (+ that's the whole point of one interface and different implementations
Common pitfall: Don't forget to include a *.def file or exported functions can't be seen by COM.
If you have questions mail com_me@nukesoftware.com
Have fun and make component based systems
Odin Jensen
Lead Programmer
Nuke Software
To Uninstall the components run Uninstall.bat
This simple COM tutorial just creates to fictive "renders" as COM objects and shows how to select a between different components that support the same interface.
Disclaimer: This has nothing to do with a real render. It's only a COM test.
Important: COM interfaces cannot change, or you must create a completely new interface and still retain the old one. (Like DirectX) As long as you don't alter the interface you can change the code to your heart's content without requiring a recompile of the client that uses the component. If two apps use the same component it's only loaded once and unloaded when all are done using it via refcounting.
API hint: If you have different components for each API, don't expose it to the outside world. That way a user of, say, the DirectX8 render will only need the runtime and not the SDK. (+ that's the whole point of one interface and different implementations
Common pitfall: Don't forget to include a *.def file or exported functions can't be seen by COM.
If you have questions mail com_me@nukesoftware.com
Have fun and make component based systems
Odin Jensen
Lead Programmer
Nuke Software
Download attached article resource


















