如何去掉这个提示??
我从VC板块看了一下,好像用Vc/Atl有办法做到,但是C++Builder不知道怎么实现??
14 个解决方案
#1
不会,占坑,学习!UP!
#2
再来!UP!
#3
这个是把IE里安全级别为最低就行了。如果其他人用就得有CA认证。如网络实名之类的样子
#4
我的ActiveX已经经过数字签名了,但是还有这个问题
#5
关注
#6
有人知道吗?大家帮帮忙!
莫非真的无法实现?
莫非真的无法实现?
#7
呵呵,问题解决了!方法如下:
BEGIN_CATEGORY_MAP(CYourComObject)
IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
END_CATEGORY_MAP()
BEGIN_CATEGORY_MAP(CYourComObject)
IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
END_CATEGORY_MAP()
#8
楼主精神值得学习:)
#9
BEGIN_CATEGORY_MAP(CYourComObject)
IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
END_CATEGORY_MAP()
请问加到那,需要改什么吗?
IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
END_CATEGORY_MAP()
请问加到那,需要改什么吗?
#10
深入解析ATL上就有,可惜我来晚了,昨天刚解决这个问题。
写在这个里面的public,就可以了
class ATL_NO_VTABLE TSignActiveFormXImpl:
VCLCONTROL_IMPL(TSignActiveFormXImpl, SignActiveFormX, TSignActiveFormX, ISignActiveFormX, DIID_ISignActiveFormXEvents)
{
void __fastcall ActivateEvent(TObject *Sender);
void __fastcall ClickEvent(TObject *Sender);
void __fastcall CreateEvent(TObject *Sender);
void __fastcall DblClickEvent(TObject *Sender);
void __fastcall DeactivateEvent(TObject *Sender);
void __fastcall DestroyEvent(TObject *Sender);
void __fastcall KeyPressEvent(TObject *Sender, char &Key);
void __fastcall PaintEvent(TObject *Sender);
public:
void InitializeControl()
{
m_VclCtl->OnActivate = ActivateEvent;
m_VclCtl->OnClick = ClickEvent;
m_VclCtl->OnCreate = CreateEvent;
m_VclCtl->OnDblClick = DblClickEvent;
m_VclCtl->OnDeactivate = DeactivateEvent;
m_VclCtl->OnDestroy = DestroyEvent;
m_VclCtl->OnKeyPress = KeyPressEvent;
m_VclCtl->OnPaint = PaintEvent;
}
// The COM MAP entries declares the interfaces your object exposes (through
// QueryInterface). CComRootObjectEx::InternalQueryInterface only returns
// pointers for interfaces in the COM map. VCL controls exposed as OCXes
// have a minimum set of interfaces defined by the
// VCL_CONTROL_COM_INTERFACE_ENTRIES macro. Add other interfaces supported
// by your object with additional COM_INTERFACE_ENTRY[_xxx] macros.
//
BEGIN_COM_MAP(TSignActiveFormXImpl)
VCL_CONTROL_COM_INTERFACE_ENTRIES(ISignActiveFormX)
END_COM_MAP()
//在这里,看到了吗?
BEGIN_CATEGORY_MAP(CYourComObject)
IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
END_CATEGORY_MAP()
// The PROPERTY map stores property descriptions, property DISPIDs,
// property page CLSIDs and IDispatch IIDs. You may use use
// IPerPropertyBrowsingImpl, IPersistPropertyBagImpl, IPersistStreamInitImpl,
// and ISpecifyPropertyPageImpl to utilize the information in you property
// map.
//
// NOTE: The BCB Wizard does *NOT* maintain your PROPERTY_MAP table. You must
// add or remove entries manually.
//
BEGIN_PROPERTY_MAP(TSignActiveFormXImpl)
// PROP_PAGE(CLSID_SignActiveFormXPage)
END_PROPERTY_MAP()
/* DECLARE_VCL_CONTROL_PERSISTENCE(CppClass, VclClass) is needed for VCL
* controls to persist via the VCL streaming mechanism and not the ATL mechanism.
* The macro adds static IPersistStreamInit_Load and IPersistStreamInit_Save
* methods to your implementation class, overriding the methods in IPersistStreamImpl.
* This macro must be manually undefined or removed if you port to C++Builder 4.0. */
DECLARE_VCL_CONTROL_PERSISTENCE(TSignActiveFormXImpl, TSignActiveFormX);
// The DECLARE_ACTIVEXCONTROL_REGISTRY macro declares a static 'UpdateRegistry'
// routine which registers the basic information about your control. The
// parameters expected by the macro are the ProgId & the ToolboxBitmap ID of
// your control.
//
DECLARE_ACTIVEXCONTROL_REGISTRY("SignActiveFormProj1.SignActiveFormX", 1);
protected:
STDMETHOD(_set_Font(IFontDisp** Value));
STDMETHOD(get_Active(VARIANT_BOOL* Value));
STDMETHOD(get_AlignDisabled(VARIANT_BOOL* Value));
STDMETHOD(get_AutoScroll(VARIANT_BOOL* Value));
STDMETHOD(get_AutoSize(VARIANT_BOOL* Value));
STDMETHOD(get_AxBorderStyle(TxActiveFormBorderStyle* Value));
STDMETHOD(get_BorderWidth(long* Value));
STDMETHOD(get_Caption(BSTR* Value));
STDMETHOD(get_Color(::OLE_COLOR* Value));
STDMETHOD(get_DoubleBuffered(VARIANT_BOOL* Value));
STDMETHOD(get_DropTarget(VARIANT_BOOL* Value));
STDMETHOD(get_Enabled(VARIANT_BOOL* Value));
STDMETHOD(get_Font(IFontDisp** Value));
STDMETHOD(get_HelpFile(BSTR* Value));
STDMETHOD(get_KeyPreview(VARIANT_BOOL* Value));
STDMETHOD(get_PixelsPerInch(long* Value));
STDMETHOD(get_PrintScale(TxPrintScale* Value));
STDMETHOD(get_Scaled(VARIANT_BOOL* Value));
STDMETHOD(get_Visible(VARIANT_BOOL* Value));
STDMETHOD(get_VisibleDockClientCount(long* Value));
STDMETHOD(set_AutoScroll(VARIANT_BOOL Value));
STDMETHOD(set_AutoSize(VARIANT_BOOL Value));
STDMETHOD(set_AxBorderStyle(TxActiveFormBorderStyle Value));
STDMETHOD(set_BorderWidth(long Value));
STDMETHOD(set_Caption(BSTR Value));
STDMETHOD(set_Color(::OLE_COLOR Value));
STDMETHOD(set_DoubleBuffered(VARIANT_BOOL Value));
STDMETHOD(set_DropTarget(VARIANT_BOOL Value));
STDMETHOD(set_Enabled(VARIANT_BOOL Value));
STDMETHOD(set_Font(IFontDisp* Value));
STDMETHOD(set_HelpFile(BSTR Value));
STDMETHOD(set_KeyPreview(VARIANT_BOOL Value));
STDMETHOD(set_PixelsPerInch(long Value));
STDMETHOD(set_PrintScale(TxPrintScale Value));
STDMETHOD(set_Scaled(VARIANT_BOOL Value));
STDMETHOD(set_Visible(VARIANT_BOOL Value));
STDMETHOD(get_SignStr(BSTR* Value));
STDMETHOD(set_SignStr(BSTR Value));
STDMETHOD(test(BSTR str));
STDMETHOD(test2(BSTR* str));
STDMETHOD(mySign());
STDMETHOD(errorCode(BSTR* errorCode));
};
//---------------------------------------------------------------------------
#endif
写在这个里面的public,就可以了
class ATL_NO_VTABLE TSignActiveFormXImpl:
VCLCONTROL_IMPL(TSignActiveFormXImpl, SignActiveFormX, TSignActiveFormX, ISignActiveFormX, DIID_ISignActiveFormXEvents)
{
void __fastcall ActivateEvent(TObject *Sender);
void __fastcall ClickEvent(TObject *Sender);
void __fastcall CreateEvent(TObject *Sender);
void __fastcall DblClickEvent(TObject *Sender);
void __fastcall DeactivateEvent(TObject *Sender);
void __fastcall DestroyEvent(TObject *Sender);
void __fastcall KeyPressEvent(TObject *Sender, char &Key);
void __fastcall PaintEvent(TObject *Sender);
public:
void InitializeControl()
{
m_VclCtl->OnActivate = ActivateEvent;
m_VclCtl->OnClick = ClickEvent;
m_VclCtl->OnCreate = CreateEvent;
m_VclCtl->OnDblClick = DblClickEvent;
m_VclCtl->OnDeactivate = DeactivateEvent;
m_VclCtl->OnDestroy = DestroyEvent;
m_VclCtl->OnKeyPress = KeyPressEvent;
m_VclCtl->OnPaint = PaintEvent;
}
// The COM MAP entries declares the interfaces your object exposes (through
// QueryInterface). CComRootObjectEx::InternalQueryInterface only returns
// pointers for interfaces in the COM map. VCL controls exposed as OCXes
// have a minimum set of interfaces defined by the
// VCL_CONTROL_COM_INTERFACE_ENTRIES macro. Add other interfaces supported
// by your object with additional COM_INTERFACE_ENTRY[_xxx] macros.
//
BEGIN_COM_MAP(TSignActiveFormXImpl)
VCL_CONTROL_COM_INTERFACE_ENTRIES(ISignActiveFormX)
END_COM_MAP()
//在这里,看到了吗?
BEGIN_CATEGORY_MAP(CYourComObject)
IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
END_CATEGORY_MAP()
// The PROPERTY map stores property descriptions, property DISPIDs,
// property page CLSIDs and IDispatch IIDs. You may use use
// IPerPropertyBrowsingImpl, IPersistPropertyBagImpl, IPersistStreamInitImpl,
// and ISpecifyPropertyPageImpl to utilize the information in you property
// map.
//
// NOTE: The BCB Wizard does *NOT* maintain your PROPERTY_MAP table. You must
// add or remove entries manually.
//
BEGIN_PROPERTY_MAP(TSignActiveFormXImpl)
// PROP_PAGE(CLSID_SignActiveFormXPage)
END_PROPERTY_MAP()
/* DECLARE_VCL_CONTROL_PERSISTENCE(CppClass, VclClass) is needed for VCL
* controls to persist via the VCL streaming mechanism and not the ATL mechanism.
* The macro adds static IPersistStreamInit_Load and IPersistStreamInit_Save
* methods to your implementation class, overriding the methods in IPersistStreamImpl.
* This macro must be manually undefined or removed if you port to C++Builder 4.0. */
DECLARE_VCL_CONTROL_PERSISTENCE(TSignActiveFormXImpl, TSignActiveFormX);
// The DECLARE_ACTIVEXCONTROL_REGISTRY macro declares a static 'UpdateRegistry'
// routine which registers the basic information about your control. The
// parameters expected by the macro are the ProgId & the ToolboxBitmap ID of
// your control.
//
DECLARE_ACTIVEXCONTROL_REGISTRY("SignActiveFormProj1.SignActiveFormX", 1);
protected:
STDMETHOD(_set_Font(IFontDisp** Value));
STDMETHOD(get_Active(VARIANT_BOOL* Value));
STDMETHOD(get_AlignDisabled(VARIANT_BOOL* Value));
STDMETHOD(get_AutoScroll(VARIANT_BOOL* Value));
STDMETHOD(get_AutoSize(VARIANT_BOOL* Value));
STDMETHOD(get_AxBorderStyle(TxActiveFormBorderStyle* Value));
STDMETHOD(get_BorderWidth(long* Value));
STDMETHOD(get_Caption(BSTR* Value));
STDMETHOD(get_Color(::OLE_COLOR* Value));
STDMETHOD(get_DoubleBuffered(VARIANT_BOOL* Value));
STDMETHOD(get_DropTarget(VARIANT_BOOL* Value));
STDMETHOD(get_Enabled(VARIANT_BOOL* Value));
STDMETHOD(get_Font(IFontDisp** Value));
STDMETHOD(get_HelpFile(BSTR* Value));
STDMETHOD(get_KeyPreview(VARIANT_BOOL* Value));
STDMETHOD(get_PixelsPerInch(long* Value));
STDMETHOD(get_PrintScale(TxPrintScale* Value));
STDMETHOD(get_Scaled(VARIANT_BOOL* Value));
STDMETHOD(get_Visible(VARIANT_BOOL* Value));
STDMETHOD(get_VisibleDockClientCount(long* Value));
STDMETHOD(set_AutoScroll(VARIANT_BOOL Value));
STDMETHOD(set_AutoSize(VARIANT_BOOL Value));
STDMETHOD(set_AxBorderStyle(TxActiveFormBorderStyle Value));
STDMETHOD(set_BorderWidth(long Value));
STDMETHOD(set_Caption(BSTR Value));
STDMETHOD(set_Color(::OLE_COLOR Value));
STDMETHOD(set_DoubleBuffered(VARIANT_BOOL Value));
STDMETHOD(set_DropTarget(VARIANT_BOOL Value));
STDMETHOD(set_Enabled(VARIANT_BOOL Value));
STDMETHOD(set_Font(IFontDisp* Value));
STDMETHOD(set_HelpFile(BSTR Value));
STDMETHOD(set_KeyPreview(VARIANT_BOOL Value));
STDMETHOD(set_PixelsPerInch(long Value));
STDMETHOD(set_PrintScale(TxPrintScale Value));
STDMETHOD(set_Scaled(VARIANT_BOOL Value));
STDMETHOD(set_Visible(VARIANT_BOOL Value));
STDMETHOD(get_SignStr(BSTR* Value));
STDMETHOD(set_SignStr(BSTR Value));
STDMETHOD(test(BSTR str));
STDMETHOD(test2(BSTR* str));
STDMETHOD(mySign());
STDMETHOD(errorCode(BSTR* errorCode));
};
//---------------------------------------------------------------------------
#endif
#11
//在这里,看到了吗?
BEGIN_CATEGORY_MAP(CYourComObject)
IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
END_CATEGORY_MAP()
CYourComObject应该是什么
其他的变吗,我照般上去的不行
BEGIN_CATEGORY_MAP(CYourComObject)
IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
END_CATEGORY_MAP()
CYourComObject应该是什么
其他的变吗,我照般上去的不行
#12
这是ActiveFormImpl1.h里的声明,你只需要把上边的代码写在public里就可以了。
#13
BEGIN_CATEGORY_MAP(CYourComObject)
IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
END_CATEGORY_MAP()
这些代码我照搬到我的public上去了,什么都没改,怎么还不行, aawolf(羌狼) 大侠谢谢你回答!
IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
END_CATEGORY_MAP()
这些代码我照搬到我的public上去了,什么都没改,怎么还不行, aawolf(羌狼) 大侠谢谢你回答!
#14
关注!还有,数字签名怎么做?
#1
不会,占坑,学习!UP!
#2
再来!UP!
#3
这个是把IE里安全级别为最低就行了。如果其他人用就得有CA认证。如网络实名之类的样子
#4
我的ActiveX已经经过数字签名了,但是还有这个问题
#5
关注
#6
有人知道吗?大家帮帮忙!
莫非真的无法实现?
莫非真的无法实现?
#7
呵呵,问题解决了!方法如下:
BEGIN_CATEGORY_MAP(CYourComObject)
IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
END_CATEGORY_MAP()
BEGIN_CATEGORY_MAP(CYourComObject)
IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
END_CATEGORY_MAP()
#8
楼主精神值得学习:)
#9
BEGIN_CATEGORY_MAP(CYourComObject)
IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
END_CATEGORY_MAP()
请问加到那,需要改什么吗?
IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
END_CATEGORY_MAP()
请问加到那,需要改什么吗?
#10
深入解析ATL上就有,可惜我来晚了,昨天刚解决这个问题。
写在这个里面的public,就可以了
class ATL_NO_VTABLE TSignActiveFormXImpl:
VCLCONTROL_IMPL(TSignActiveFormXImpl, SignActiveFormX, TSignActiveFormX, ISignActiveFormX, DIID_ISignActiveFormXEvents)
{
void __fastcall ActivateEvent(TObject *Sender);
void __fastcall ClickEvent(TObject *Sender);
void __fastcall CreateEvent(TObject *Sender);
void __fastcall DblClickEvent(TObject *Sender);
void __fastcall DeactivateEvent(TObject *Sender);
void __fastcall DestroyEvent(TObject *Sender);
void __fastcall KeyPressEvent(TObject *Sender, char &Key);
void __fastcall PaintEvent(TObject *Sender);
public:
void InitializeControl()
{
m_VclCtl->OnActivate = ActivateEvent;
m_VclCtl->OnClick = ClickEvent;
m_VclCtl->OnCreate = CreateEvent;
m_VclCtl->OnDblClick = DblClickEvent;
m_VclCtl->OnDeactivate = DeactivateEvent;
m_VclCtl->OnDestroy = DestroyEvent;
m_VclCtl->OnKeyPress = KeyPressEvent;
m_VclCtl->OnPaint = PaintEvent;
}
// The COM MAP entries declares the interfaces your object exposes (through
// QueryInterface). CComRootObjectEx::InternalQueryInterface only returns
// pointers for interfaces in the COM map. VCL controls exposed as OCXes
// have a minimum set of interfaces defined by the
// VCL_CONTROL_COM_INTERFACE_ENTRIES macro. Add other interfaces supported
// by your object with additional COM_INTERFACE_ENTRY[_xxx] macros.
//
BEGIN_COM_MAP(TSignActiveFormXImpl)
VCL_CONTROL_COM_INTERFACE_ENTRIES(ISignActiveFormX)
END_COM_MAP()
//在这里,看到了吗?
BEGIN_CATEGORY_MAP(CYourComObject)
IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
END_CATEGORY_MAP()
// The PROPERTY map stores property descriptions, property DISPIDs,
// property page CLSIDs and IDispatch IIDs. You may use use
// IPerPropertyBrowsingImpl, IPersistPropertyBagImpl, IPersistStreamInitImpl,
// and ISpecifyPropertyPageImpl to utilize the information in you property
// map.
//
// NOTE: The BCB Wizard does *NOT* maintain your PROPERTY_MAP table. You must
// add or remove entries manually.
//
BEGIN_PROPERTY_MAP(TSignActiveFormXImpl)
// PROP_PAGE(CLSID_SignActiveFormXPage)
END_PROPERTY_MAP()
/* DECLARE_VCL_CONTROL_PERSISTENCE(CppClass, VclClass) is needed for VCL
* controls to persist via the VCL streaming mechanism and not the ATL mechanism.
* The macro adds static IPersistStreamInit_Load and IPersistStreamInit_Save
* methods to your implementation class, overriding the methods in IPersistStreamImpl.
* This macro must be manually undefined or removed if you port to C++Builder 4.0. */
DECLARE_VCL_CONTROL_PERSISTENCE(TSignActiveFormXImpl, TSignActiveFormX);
// The DECLARE_ACTIVEXCONTROL_REGISTRY macro declares a static 'UpdateRegistry'
// routine which registers the basic information about your control. The
// parameters expected by the macro are the ProgId & the ToolboxBitmap ID of
// your control.
//
DECLARE_ACTIVEXCONTROL_REGISTRY("SignActiveFormProj1.SignActiveFormX", 1);
protected:
STDMETHOD(_set_Font(IFontDisp** Value));
STDMETHOD(get_Active(VARIANT_BOOL* Value));
STDMETHOD(get_AlignDisabled(VARIANT_BOOL* Value));
STDMETHOD(get_AutoScroll(VARIANT_BOOL* Value));
STDMETHOD(get_AutoSize(VARIANT_BOOL* Value));
STDMETHOD(get_AxBorderStyle(TxActiveFormBorderStyle* Value));
STDMETHOD(get_BorderWidth(long* Value));
STDMETHOD(get_Caption(BSTR* Value));
STDMETHOD(get_Color(::OLE_COLOR* Value));
STDMETHOD(get_DoubleBuffered(VARIANT_BOOL* Value));
STDMETHOD(get_DropTarget(VARIANT_BOOL* Value));
STDMETHOD(get_Enabled(VARIANT_BOOL* Value));
STDMETHOD(get_Font(IFontDisp** Value));
STDMETHOD(get_HelpFile(BSTR* Value));
STDMETHOD(get_KeyPreview(VARIANT_BOOL* Value));
STDMETHOD(get_PixelsPerInch(long* Value));
STDMETHOD(get_PrintScale(TxPrintScale* Value));
STDMETHOD(get_Scaled(VARIANT_BOOL* Value));
STDMETHOD(get_Visible(VARIANT_BOOL* Value));
STDMETHOD(get_VisibleDockClientCount(long* Value));
STDMETHOD(set_AutoScroll(VARIANT_BOOL Value));
STDMETHOD(set_AutoSize(VARIANT_BOOL Value));
STDMETHOD(set_AxBorderStyle(TxActiveFormBorderStyle Value));
STDMETHOD(set_BorderWidth(long Value));
STDMETHOD(set_Caption(BSTR Value));
STDMETHOD(set_Color(::OLE_COLOR Value));
STDMETHOD(set_DoubleBuffered(VARIANT_BOOL Value));
STDMETHOD(set_DropTarget(VARIANT_BOOL Value));
STDMETHOD(set_Enabled(VARIANT_BOOL Value));
STDMETHOD(set_Font(IFontDisp* Value));
STDMETHOD(set_HelpFile(BSTR Value));
STDMETHOD(set_KeyPreview(VARIANT_BOOL Value));
STDMETHOD(set_PixelsPerInch(long Value));
STDMETHOD(set_PrintScale(TxPrintScale Value));
STDMETHOD(set_Scaled(VARIANT_BOOL Value));
STDMETHOD(set_Visible(VARIANT_BOOL Value));
STDMETHOD(get_SignStr(BSTR* Value));
STDMETHOD(set_SignStr(BSTR Value));
STDMETHOD(test(BSTR str));
STDMETHOD(test2(BSTR* str));
STDMETHOD(mySign());
STDMETHOD(errorCode(BSTR* errorCode));
};
//---------------------------------------------------------------------------
#endif
写在这个里面的public,就可以了
class ATL_NO_VTABLE TSignActiveFormXImpl:
VCLCONTROL_IMPL(TSignActiveFormXImpl, SignActiveFormX, TSignActiveFormX, ISignActiveFormX, DIID_ISignActiveFormXEvents)
{
void __fastcall ActivateEvent(TObject *Sender);
void __fastcall ClickEvent(TObject *Sender);
void __fastcall CreateEvent(TObject *Sender);
void __fastcall DblClickEvent(TObject *Sender);
void __fastcall DeactivateEvent(TObject *Sender);
void __fastcall DestroyEvent(TObject *Sender);
void __fastcall KeyPressEvent(TObject *Sender, char &Key);
void __fastcall PaintEvent(TObject *Sender);
public:
void InitializeControl()
{
m_VclCtl->OnActivate = ActivateEvent;
m_VclCtl->OnClick = ClickEvent;
m_VclCtl->OnCreate = CreateEvent;
m_VclCtl->OnDblClick = DblClickEvent;
m_VclCtl->OnDeactivate = DeactivateEvent;
m_VclCtl->OnDestroy = DestroyEvent;
m_VclCtl->OnKeyPress = KeyPressEvent;
m_VclCtl->OnPaint = PaintEvent;
}
// The COM MAP entries declares the interfaces your object exposes (through
// QueryInterface). CComRootObjectEx::InternalQueryInterface only returns
// pointers for interfaces in the COM map. VCL controls exposed as OCXes
// have a minimum set of interfaces defined by the
// VCL_CONTROL_COM_INTERFACE_ENTRIES macro. Add other interfaces supported
// by your object with additional COM_INTERFACE_ENTRY[_xxx] macros.
//
BEGIN_COM_MAP(TSignActiveFormXImpl)
VCL_CONTROL_COM_INTERFACE_ENTRIES(ISignActiveFormX)
END_COM_MAP()
//在这里,看到了吗?
BEGIN_CATEGORY_MAP(CYourComObject)
IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
END_CATEGORY_MAP()
// The PROPERTY map stores property descriptions, property DISPIDs,
// property page CLSIDs and IDispatch IIDs. You may use use
// IPerPropertyBrowsingImpl, IPersistPropertyBagImpl, IPersistStreamInitImpl,
// and ISpecifyPropertyPageImpl to utilize the information in you property
// map.
//
// NOTE: The BCB Wizard does *NOT* maintain your PROPERTY_MAP table. You must
// add or remove entries manually.
//
BEGIN_PROPERTY_MAP(TSignActiveFormXImpl)
// PROP_PAGE(CLSID_SignActiveFormXPage)
END_PROPERTY_MAP()
/* DECLARE_VCL_CONTROL_PERSISTENCE(CppClass, VclClass) is needed for VCL
* controls to persist via the VCL streaming mechanism and not the ATL mechanism.
* The macro adds static IPersistStreamInit_Load and IPersistStreamInit_Save
* methods to your implementation class, overriding the methods in IPersistStreamImpl.
* This macro must be manually undefined or removed if you port to C++Builder 4.0. */
DECLARE_VCL_CONTROL_PERSISTENCE(TSignActiveFormXImpl, TSignActiveFormX);
// The DECLARE_ACTIVEXCONTROL_REGISTRY macro declares a static 'UpdateRegistry'
// routine which registers the basic information about your control. The
// parameters expected by the macro are the ProgId & the ToolboxBitmap ID of
// your control.
//
DECLARE_ACTIVEXCONTROL_REGISTRY("SignActiveFormProj1.SignActiveFormX", 1);
protected:
STDMETHOD(_set_Font(IFontDisp** Value));
STDMETHOD(get_Active(VARIANT_BOOL* Value));
STDMETHOD(get_AlignDisabled(VARIANT_BOOL* Value));
STDMETHOD(get_AutoScroll(VARIANT_BOOL* Value));
STDMETHOD(get_AutoSize(VARIANT_BOOL* Value));
STDMETHOD(get_AxBorderStyle(TxActiveFormBorderStyle* Value));
STDMETHOD(get_BorderWidth(long* Value));
STDMETHOD(get_Caption(BSTR* Value));
STDMETHOD(get_Color(::OLE_COLOR* Value));
STDMETHOD(get_DoubleBuffered(VARIANT_BOOL* Value));
STDMETHOD(get_DropTarget(VARIANT_BOOL* Value));
STDMETHOD(get_Enabled(VARIANT_BOOL* Value));
STDMETHOD(get_Font(IFontDisp** Value));
STDMETHOD(get_HelpFile(BSTR* Value));
STDMETHOD(get_KeyPreview(VARIANT_BOOL* Value));
STDMETHOD(get_PixelsPerInch(long* Value));
STDMETHOD(get_PrintScale(TxPrintScale* Value));
STDMETHOD(get_Scaled(VARIANT_BOOL* Value));
STDMETHOD(get_Visible(VARIANT_BOOL* Value));
STDMETHOD(get_VisibleDockClientCount(long* Value));
STDMETHOD(set_AutoScroll(VARIANT_BOOL Value));
STDMETHOD(set_AutoSize(VARIANT_BOOL Value));
STDMETHOD(set_AxBorderStyle(TxActiveFormBorderStyle Value));
STDMETHOD(set_BorderWidth(long Value));
STDMETHOD(set_Caption(BSTR Value));
STDMETHOD(set_Color(::OLE_COLOR Value));
STDMETHOD(set_DoubleBuffered(VARIANT_BOOL Value));
STDMETHOD(set_DropTarget(VARIANT_BOOL Value));
STDMETHOD(set_Enabled(VARIANT_BOOL Value));
STDMETHOD(set_Font(IFontDisp* Value));
STDMETHOD(set_HelpFile(BSTR Value));
STDMETHOD(set_KeyPreview(VARIANT_BOOL Value));
STDMETHOD(set_PixelsPerInch(long Value));
STDMETHOD(set_PrintScale(TxPrintScale Value));
STDMETHOD(set_Scaled(VARIANT_BOOL Value));
STDMETHOD(set_Visible(VARIANT_BOOL Value));
STDMETHOD(get_SignStr(BSTR* Value));
STDMETHOD(set_SignStr(BSTR Value));
STDMETHOD(test(BSTR str));
STDMETHOD(test2(BSTR* str));
STDMETHOD(mySign());
STDMETHOD(errorCode(BSTR* errorCode));
};
//---------------------------------------------------------------------------
#endif
#11
//在这里,看到了吗?
BEGIN_CATEGORY_MAP(CYourComObject)
IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
END_CATEGORY_MAP()
CYourComObject应该是什么
其他的变吗,我照般上去的不行
BEGIN_CATEGORY_MAP(CYourComObject)
IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
END_CATEGORY_MAP()
CYourComObject应该是什么
其他的变吗,我照般上去的不行
#12
这是ActiveFormImpl1.h里的声明,你只需要把上边的代码写在public里就可以了。
#13
BEGIN_CATEGORY_MAP(CYourComObject)
IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
END_CATEGORY_MAP()
这些代码我照搬到我的public上去了,什么都没改,怎么还不行, aawolf(羌狼) 大侠谢谢你回答!
IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
END_CATEGORY_MAP()
这些代码我照搬到我的public上去了,什么都没改,怎么还不行, aawolf(羌狼) 大侠谢谢你回答!
#14
关注!还有,数字签名怎么做?