admin管理员组文章数量:1636900
IMPLEMENT_DYNCREATE
This macro must appear in the implementation file for any class that uses DECLARE_OLECREATE.
The external name is the identifier exposed to other applications. Client applications use the external name to request an object of this class from an automation server.
The OLE class ID is a unique 128-bit identifier for the object. It consists of one long, two WORDs, and eight BYTEs, as represented by l, w1, w2, and b1 through b8 in the syntax description. ClassWizard and AppWizard create unique OLE class IDs for you as required.
Parameters
class_name
派生类名.
base_class_name
基类名.
Remarks
框架使用这种技巧动态的创建新的对象。如,序列化时,从盘中读一个对象。在类实现的文件中添加宏IMPLEMENT_DYNCREATE. For more information, see .
如果你使用了DECLARE_DYNCREATE 和 IMPLEMENT_DYNCREATE 宏, 你可以使用RUNTIME_CLASS 宏和 CObject::IsKindOf 成员函数去决定是否在运行时中创建宏.
如果类声明的文件中包含有DECLARE_DYNCREATE, 类实现的文件中必须有 IMPLEMENT_DYNCREATE.
Example
/* CAge.h */
class CAge : public CObject
{
int num;
public:
DECLARE_DYNCREATE(CAge)
};
//==============
/* CAge.cpp */
#include "stdafx.h"
#include "CAge.h"
IMPLEMENT_DYNCREATE(CAge, CObject)
本文标签: IMPLEMENTDYNCREATE
版权声明:本文标题:IMPLEMENT_DYNCREATE 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/xitong/1729234150a1191797.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论