I done it like as Kim Gräsman advised in
https://stackoverflow.com/a/1854637/3127177
Here my way for the application TheServerApp :
all with installed Microsoft Visual Studio Community 2017
with command line
Search and execute vcvars32.bat
then execute
oleview
(if it makes problem the first time oleview.exe has to been executed as administrator)
in oleview window choose View TypeLibs
and open TheServerApp.exe
and then File -> Save As
So the IDL definitions are stored in TheServerApp.idl
cd where TheServerApp.IDL is located
and execute
midl TheServerApp.IDL
because I got the errors
TheServerApp.IDL(481) : error MIDL2025 : syntax error : expecting a type specification near "single"
Client\TheServerApp.IDL(481) : error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation
I edited TheServerApp.IDL and replaced all words single with double
( see here )
Now the execution of midl TheServerApp**.IDL**
results in the file TheServerApp**.tlb**
because #import TheServerApp.tlb in the Visual Studio project reports an error
write a small program imports.cpp in your project with the content:
// file to import with full path
**#import** " ... /**TheServerApp.tlb**"
int main(int argc, char* argv[])
{
}
and in Command Line with executed vcvars32.bat as above
execute
cl ./imports.cpp
which generates TheServerApp**.tlh** and TheServerApp**.tli**
in .cpp I included
#include "./TheServerApp.tlh"
#include "./TheServerApp.tli"
I generated also TheServerApp.dll, but don't know it will be needed further
tlbimp TheServerApp.tlb
which reports
TlbImp : Type library imported to TheServerApp.dll
so there is also the file TheServerApp.dll
for the next steps I have to study more
Erhy