I’m trying to interface a library that exports an Automation compatible interface via a .TLB.
The TLB lists functions inside the interfaces to retrieve object references; the .TLH includes these as nonstatic member functions, which makes it difficult for me to call them without an object reference; thus, I have a bit of a chicken-and-egg problem here.
What is the correct way to invoke functions from C++?
Use
#importon the .tlb file, then useCreateInstance()method of an appropriate smart pointer type to instantiate the object, then just call member functions.Something like this (error handling omitted):