COM to this thread

Started by
3 comments, last by Orikal 22 years, 1 month ago
Alright, I need to get some work experience programming period before I can program games. Looks like the business force is all about using databases and making COM objects. And since I live in the Wichita, KS area, I''m not going to find any game developing experience. I''ve been programming for 5 years on my own with an emphasis on C++. I''ve fiddle around with Visual Basic when I made some ASP database applications at my last job. Frankly, I think Visual Basic looks very simple compared to C++, but I can''t figure out exactly what ActiveX, COM, or DCOM are. I''ve done alot of OOP and I know they are object oriented. So finally to my question: could someone point me in the right direction so I can start learning COM, code these databases, and get on to game programming? Thanks for your help.
Advertisement
hmmm COM is an old technology but still useful to learn. If there is one tip I can give you is to look into .NET. .NET services are going to be what COM/DCOM are now. An excellent book to get on COM would be this one:

http://www.amazon.com/exec/obidos/ASIN/1556227043/qid=1017883327/sr=8-1/ref=sr_8_67_1/002-4089471-4388800

I own a LOT of good COM books (Essential COM, Learning DCOM etc) but this one was the most clear and straight forward. It focuses heavily on what COM is about and why it was developed and uses examples (in C++.) It then goes on to focus on developing COM applications using ATL. The great part is that it shows you how to do it in raw C++ and then in C++ with ATL support. By doing things this way, you understand the framework of ATL better and how it helps you develop COM applications.

BTW I've been working with COM based technologies for the last 4 years. I've implemented COM components in C++ and VB. This book really helped me out on one project.

Still, do yourself a favour and look into .NET as well.

Regards,

Dire

[edited by - Dire.Wolf on April 3, 2002 8:35:19 PM]
[email=direwolf@digitalfiends.com]Dire Wolf[/email]
www.digitalfiends.com
COM is pretty much just a standard. The most basic idea of it is that a COM object just keeps track of how many people are referencing it, and when it reaches 0, it destroys itself. Self management. Of course there is more to it, but there is not any magic, just a standard.

I can not remember the title right now, but there is a COM book by MicrosoftPress (red cover). The first several chapters explain the interfaces of COM and what it is about.

With a standard being set, it is easier to start integrating different languages together, like VC and VB.

As far as learning how C++. VB, COM, ActiveX, etc. fit together, here is a good path to take that eases you through the process:

1) Start with learning the basics of VB. Learn how to use some of the more difficult controls (ex. Treecontrol). VB is great for making tools, and provides an easy way to manage things.
2) Learn to create a custom control in VB. This will give you your first taste starting to have control over what you use, and integrating it in your project. A good example is your own text box control that can be set up for handling different formats. Nothing like being able to just plop down your textbox control, set a property for ''money'', and it will stop the user from doing stupid things.
3) Learn to create a custom control, or dll, with ATL that you can use in VB. VC++ has a very nice interface for easily creating ATL controls. Now you can wrap your c++ up, and easily integrate it into your VB framework.
4) As for hitting a database, I would recomend first looking at using ADO via VB.

How does this connect to games?
1) Tools - everything mentioned above really helps out in making tools. I made an ATL dll that wrapped up my engine (C++), gave it to a friend, so he could create a world editor with it (VB). The whole project was done very fast, and is easy to manage.
2) Events - you get experience handling events and dealing with them. Many people create menu systems for their games in the same fashion of how Windows does it. This is proven and effective system. At least it worked for me really well.
3) Creating libraries - VC++ can be pretty intimedating. By getting your hands dirty in other parts, it becomes less "Scary".

If you go through that MSPress book, you will do the COM stuff by hand, and it is good to see the idea behind it. After that, you will most likely never do it again. However, when you are using DirectX libraries, you will have a greater understanding of how to handle its objects better. When it says to Query for an interface, you will hopefully fully understand what is going on.

Good Luck!
ATL COM tutorial
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
If you want an example of database programming, I''d be happy to share my current project with you. I''m making a Query Analyzer using ODBC. As with COM, we''re in the same boat pretty much . Email me if you want the Query Analyzer code.

This topic is closed to new replies.

Advertisement