📄 easycics_ocx.cpp
字号:
// ************************************************************************ //
// WARNING
// -------
// The types declared in this file were generated from data read from a
// Type Library. If this type library is explicitly or indirectly (via
// another type library referring to this type library) re-imported, or the
// 'Refresh' command of the Type Library Editor activated while editing the
// Type Library, the contents of this file will be regenerated and all
// manual modifications will be lost.
// ************************************************************************ //
// C++ TLBWRTR : $Revision: 1.134.1.41 $
// File generated on 2001-7-31 16:14:32 from Type Library described below.
// ************************************************************************ //
// Type Lib: D:\ibm\w2k\ibmchina\easycics\EcOle.dll (1)
// IID\LCID: {5B554861-ACC5-11D4-8403-EA6165000000}\0
// Helpfile:
// DepndLst:
// (1) v2.0 stdole, (E:\WIN2K\System32\stdole2.tlb)
// (2) v4.0 StdVCL, (E:\WIN2K\System32\STDVCL40.DLL)
// Errors:
// Error creating palette bitmap of (TApp1) : Server D:\ibm\w2k\ibmchina\easycics\EcOle.dll contains no icons
// ************************************************************************ //
#include <vcl.h>
#pragma hdrstop
#if defined(USING_ATL)
#include <atl\atlvcl.h>
#endif
#include "EasyCics_OCX.h"
#if !defined(__PRAGMA_PACKAGE_SMART_INIT)
#define __PRAGMA_PACKAGE_SMART_INIT
#pragma package(smart_init)
#endif
namespace Easycics_tlb
{
IAppPtr& TApp1::GetDefaultInterface()
{
if (!m_DefaultIntf)
Connect();
return m_DefaultIntf;
}
_di_IUnknown __fastcall TApp1::GetDunk()
{
_di_IUnknown diUnk;
if (m_DefaultIntf) {
IUnknownPtr punk = m_DefaultIntf;
diUnk = LPUNKNOWN(punk);
}
return diUnk;
}
void __fastcall TApp1::Connect()
{
if (!m_DefaultIntf) {
_di_IUnknown punk = GetServer();
m_DefaultIntf = punk;
if (ServerData->EventIID != GUID_NULL)
ConnectEvents(GetDunk());
}
}
void __fastcall TApp1::Disconnect()
{
if (m_DefaultIntf) {
if (ServerData->EventIID != GUID_NULL)
DisconnectEvents(GetDunk());
m_DefaultIntf.Reset();
}
}
void __fastcall TApp1::BeforeDestruction()
{
Disconnect();
}
void __fastcall TApp1::ConnectTo(IAppPtr intf)
{
Disconnect();
m_DefaultIntf = intf;
if (ServerData->EventIID != GUID_NULL)
ConnectEvents(GetDunk());
}
void __fastcall TApp1::InitServerData()
{
static Oleserver::TServerData sd;
sd.ClassID = CLSID_App;
sd.IntfIID = __uuidof(IApp);
sd.EventIID= GUID_NULL;
ServerData = &sd;
}
}; // namespace Easycics_tlb
// *********************************************************************//
// The Register function is invoked by the IDE when this module is
// installed in a Package. It provides the list of Components (including
// OCXes) implemented by this module. The following implementation
// informs the IDE of the OCX proxy classes implemented here.
// *********************************************************************//
namespace Easycics_ocx
{
void __fastcall PACKAGE Register()
{
// [1]
TComponentClass cls_svr[] = {
__classid(Easycics_tlb::TApp1)
};
RegisterComponents("ActiveX", cls_svr,
sizeof(cls_svr)/sizeof(cls_svr[0])-1);
}
}; // namespace Easycics_ocx
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -