How to import a tlb and a namespace in c++ at runtime when some condition meets?

China☆狼群 提交于 2019-12-06 08:59:09

You can load a type library at runtime using LoadTypeLib.

ITypeLib *ptlib;
LoadTypeLib("sql.tlb", &ptlib);

What you do then with ptlib is kind of up in the air as you don't really say what you are trying to do with it.

ptlib is an object supporting the ITypeLib interface. It has methods which you can call to enumerate and iterate the types in the type library. Normally you use it in combination with the other interfaces like ITypeInfo and so on.

I found a fuller tutorial style document here. Also, this link here has some more detail, also it shows the header file and link library you need to use.

Header                    oaidl.h, oaidl.idl
Library                   oleaut32.lib, uuid.lib
Windows Embedded CE       Windows CE 2.0 and later
Windows Mobile            Windows Mobile Version 5.0 and later
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!