Sometime ago Timovjl asked me if could be a good idea to concentrate some development efforts on OLE/COM technologies. Following this Idea I wrote this software.
This program scans type libraries and produce a 'C' header that can then be used to write programs with OLE/COM functionalities under plain 'C'.
This allows to use any control or COM object even when you don't have the IDL descriptor (and don't want to fight with MS bloated headers).
Of course to use an object you must know what it does and you must know the OLE/COM object programming. To learn about OLE/COM I suggest to read the excellent articles from Jeff Glatt on
codeproject.com.
This is an alpha release with some known limitations:
1. The program don't looks for definition order, some type definitions can follow their usage. In this case you have to manually reorder the record or unions definition.
2. Actually stub and proxies are not emitted.
The stubs and proxies are functions that are directly available from COM DLL's and are callable without using lpvtbl's.
Of course there will be some other bugs that I've not discovered yet. I'll be glad if you would report them.
In the thread you will also find the sample 'SimpleWebPage' that use the headers generated with FTypeLib.
'SimpleWebPage' is a demo from Jeff Glatt adapted and revised. You will find in the comments some notes about the use of FTypeLib.
05/04/2013 New Release V0.5.9.0a
05/12/2013 New Release V0.6.9.1a:
- Completely rewrote the function generation. The previous one was very buggy.
- Fixed Interface generation for bugs, and fixed the GUID generation
- Added structures predefinitions to reduce manual adjustments on generated headers
- The sample use *only* FtypeLib generated headers
- This code is original and doesn't resemble anymore any previous work (too much bugs there)
03/08/2015 New Release V0.7.0.1a
Fixed 2 major bugs:
- In not dual interfaces methods inherited from interfaces other than IDispatch and IUnknown were dropped. Now all inherited methods are correctly added.
- The property get methods don't used pointers. Corrected.
03/08/2015 New Release V0.7.0.2a
Fixed a major bug (thanks to Timo):
- The LRH (Last Right Hand Method) was not correctly handed when interface class had inherited members. Fixed.
03/09/2015 New Release V0.7.0.4a
Fixed some minor bugs and added functionalities:
- Now you can select if to emit documented or undocumented code, using Settings menu.
03/13/2015 New Release V0.8.0.0a
Fixed some minor bugs and added functionalities:
- 32 and 64 bits versions
- Addin for PellesC IDE to replace old and limited TypeLib addin
- Better GUI
- Generated code now is \n separated for correct file encoding (removed dangling \r in header files).
- The result from generation is a standard malloced memory that user can free with free() without using dynamic strings functions.
- Dynamic strings library tuned for faster code
P.S. The sample is reposted below.