The dumpcpp Tool (ActiveQt)
来源:互联网 发布:dwg文件打印软件 编辑:程序博客网 时间:2024/05/16 08:54
The dumpcpp tool generates a C++ namespace for a type library.
To generate a C++ namespace for a type library, call dumpcpp with the following command line parameters:
input
Generate documentation for input. input can specify a type library file or a type library ID, or a CLSID or ProgID for an object
-o file
Writes the class declaration to file.h and meta object infomation to file.cpp
-n namespace
Generate a C++ namespace namespace
-nometaobject
Do not generate a .cpp file with the meta object information. The meta object is then generated in runtime.
-getfile libid
Print the filename for the typelibrary libid to stdout
-compat
Generate namespace with dynamicCall-compatible API
-v
Print version information
-h
Print help
dumpcpp can be integrated into the qmake build system. In your .pro file, list the type libraries you want to use in the TYPELIBS variable:
TEMPLATE = app TARGET = qutlook CONFIG += qaxcontainer TYPELIBS = $$system(dumpcpp -getfile {00062FFF-0000-0000-C000-000000000046})The generated namespace will declare all enumerations, as well as one QAxObject subclass for each coclass and interface declared in the type library. coclasses marked with the control attribute will be wrapped by aQAxWidget subclass.
Those classes that wrap creatable coclasses (i.e. coclasses that are not marked as noncreatable) have a default constructor; this is typically a single class of type Application.
Outlook::Application *outlook = new Outlook::Application;All other classes can only be created by passing an IDispatch interface pointer to the constructor; those classes should however not be created explicitly. Instead, use the appropriate API of already created objects.
Outlook::_NameSpace *session = outlook->Session();All coclass wrappers also have one constructors taking an interface wrapper class for each interface implemented.
Outlook::NameSpace *session = outlook->Session();You have to create coclasses to be able to connect to signals of the subobject. Note that the constructor deletes the interface object, so the following will cause a segmentation fault:
Outlook::_NameSpace *tmp = outlook->Session(); Outlook::NameSpace *session = new Outlook::NameSpace(tmp); delete tmp; // or any other use of tmp: segfaultIf the return type is of a coclass or interface type declared in another type library you have to include the namespace header for that other type library before including the header for the namespace you want to use (both header have to be generated with this tool).
By default, methods and property returning subobjects will use the type as in the type library. The caller of the function is responsible for deleting or reparenting the object returned. If the -compat switch is set, properties and method returning a COM object have the return type IDispatch*, and the namespace will not declare wrapper classes for interfaces.
In this case, create the correct wrapper class explicitly:
Outlook::NameSpace *session = new Outlook::NameSpace(outlook->Session());You can of course use the IDispatch* returned directly, in which case you have to call Release() when finished with the interface.
All classes in the namespace are tagged with a macro that allows you to export or import them from a DLL. To do that, declare the macro to expand to __declspec(dllimport/export) before including the header file.
To build the tool you must first build the QAxContainer library. Then run your make tool in tools/dumpcpp.
以上介绍来自qt reference
经过试验,需要自己执行dumpcpp {00062FFF-0000-0000-C000-000000000046}生成.h和.cpp文件。
- The dumpcpp Tool (ActiveQt)
- The tool recommending -- NewSID
- about the Ant tool
- jar-The Java Archive Tool
- Prezi - the best presentation tool
- Using the WebLogic Scripting Tool
- Something about the HTK tool
- The JavaScript Code Quality Tool
- Qt 4.8中使用ActiveQt
- Qt 4.8中使用ActiveQt
- Picking the Right Development Tool @ JDJ
- Distributing Master Data Using the SMD Tool
- Sniffer tool of the net works
- Install the Web Admin Tool for TDS
- THE JAM BUILDING TOOL-Jamfile how to
- New HexorBase (The Database Hackers Tool )
- Using the 'nasl' Nessus Command Line Tool
- A Problem in the BioHDF bioh5g_import_reads tool
- BBOSS框架使用jquery方式传参到后台的时候,要注意的事项
- Cocos2d-x v3.0 渲染流水线 路线图
- eclipse中ctrl+h默认打开是JavaSearch,怎么设置成默认打开是FileSearch
- 最常用的1000个Java类 (附代码示例)
- 灰度直方图
- The dumpcpp Tool (ActiveQt)
- 天声人語 20150316
- 对VS2008创建工程时无法用UTF8编码的补救措施
- IOS 集合视图指南5:集合手势支持
- iOS学习之SQLite数据库的简单使用
- Objective-C 的“多继承”
- 日经春秋 20150316
- android网络请求
- 获取一个数据每个位上的数据