描述:
在VC++中先用一个测试程序让VC生成了该OCX的wrapper class,然后将这2个文件加入到了我的项目里。
现在有一个疑问,我该怎样生成这个OCX的实例对象呢?
我看了他的.h文件:
public:
CLSID const& GetClsid()
{
static CLSID const clsid
= { 0x12825cf, 0x9ef, 0x477e, { 0xa0, 0x2, 0x20, 0xcf, 0x31, 0x63, 0x5a, 0x7a } };
return clsid;
}
virtual BOOL Create(LPCTSTR lpszClassName,
LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect,
CWnd* pParentWnd, UINT nID,
CCreateContext* pContext = NULL)
{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID); }
BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect, CWnd* pParentWnd, UINT nID,
CFile* pPersist = NULL, BOOL bStorage = FALSE,
BSTR bstrLicKey = NULL)
{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID,
pPersist, bStorage, bstrLicKey); }
请问我该怎样调用这个create呢?要提供窗口啊、位置啊等的参数,可是我的COM服务器没有窗口啊。
:(
我可以让这几个参数为空么?
解决方案1:
CWrapperClass* pObj = new WrapperClass();
pObj.Create