• Welcome to PlanetSquires Forums.
 

COM servers (a great alternative to Windows DLLs)

Started by Paul Squires, August 16, 2017, 10:23:51 PM

Previous topic - Next topic

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:
http://www.planetsquires.com/protect/forum/index.php?topic=4073.msg30860#msg30860
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: http://www.planetsquires.com/protect/forum/index.php?topic=4073.msg30875#msg30875

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

 
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

José Roca

#1
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
https://www.codeproject.com/Articles/13601/COM-in-plain-C

COM in plain C - Part 2
https://www.codeproject.com/Articles/13862/COM-in-plain-C-Part

COM in plain C - Part 3
https://www.codeproject.com/Articles/14037/COM-in-plain-C-Part

COM in plain C - Part 4
https://www.codeproject.com/Articles/14117/COM-in-plain-C-Part

COM in plain C - Part 5
https://www.codeproject.com/Articles/14183/COM-in-plain-C-Part

COM in plain C - Part 6
https://www.codeproject.com/Articles/14905/COM-in-plain-C-Part

COM in plain C - Part 7
https://www.codeproject.com/Articles/15037/COM-in-plain-C-Part

COM in plain C - Part 8
https://www.codeproject.com/Articles/17038/COM-in-plain-C-part

Embed an HTML control in your own window using plain C
https://www.codeproject.com/Articles/3365/Embed-an-HTML-control-in-your-own-window-using-pla

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