Support Forums > General Board

COM servers (a great alternative to Windows DLLs)


Paul Squires:
Jose has created code that allows us to crate low level COM servers that act very similarly to standard Windows DLL's. They are small, extremely fast, and the code overhead is very small (less than 2K).

Follow this link to play with a simply COM dll and example code that simply loads the dll and sends and receives a string from it:
The above link and a few posts after it demonstrate the basic code and then several refinements that make the code even smaller and clearer to read.

This following link is to a great summary post that Jose wrote to explain the similarities between standard Windows DLL and COM dll's. It also helps simplify COM in broad terms:

I encourage everyone who is now programming in FreeBasic to read those posts.


Josť Roca:
The best tutorials for learning COM programming (for an ansi C, FreeBasic or PowerBasic programmer) that I know are:

COM in plain C - Part 1

COM in plain C - Part 2

COM in plain C - Part 3

COM in plain C - Part 4

COM in plain C - Part 5

COM in plain C - Part 6

COM in plain C - Part 7

COM in plain C - Part 8

Embed an HTML control in your own window using plain C

However, for understanding what I have done to create a low-level COM server with FreeBasic, only the first part is needed (and you can ignore the "Install the DLL, and register the object" part of the article) or better read what I have posted (reading too much about COM programming without a good knowledge of the basic principles can be very confusing). You must learn to walk before trying to run.

Josť Roca:
Here is an article to understand reference counting:

Managing the Lifetime of an Object


[0] Message Index

Go to full version