51 LPFUNCDESC funcDesc= 0;
52 if (SUCCEEDED(typeInfo->GetFuncDesc(index, &funcDesc))) {
60 funcDesc->cParams+1, &i);
62 typeInfo->ReleaseFuncDesc(funcDesc);
89 if (SUCCEEDED(eventTypeInfo->GetTypeAttr(&tAttr))) {
91 Count = tAttr->cFuncs;
94 for (
int i=0; i < (int)
Count; i++)
97 eventTypeInfo->ReleaseTypeAttr(tAttr);
141# pragma warning(push)
142# pragma warning(disable: 4838)
317 BCtrlI->SetAmbientDispatch(pID);
389 eventTypeInfo->Release();
409 IDispatch* pDisp = 0;
429 if (SUCCEEDED(pS->
QueryObject(IID_IDispatch, (
void**)&pID))) {
433 pS->iidEvent = iidEv;
442 pITypeInfo->GetTypeAttr(&pTA);
444 cEvents = pTA->cFuncs;
445 pITypeInfo->ReleaseTypeAttr(pTA);
446 for (i = 0; i < cEvents; i++) {
449 if (SUCCEEDED(pITypeInfo->GetFuncDesc(i, &pFD))) {
461 if (SUCCEEDED(pITypeInfo->GetNames(pFD->memid, &bstrName,
464 LANGIDFROMLCID(LOCALE_USER_DEFAULT),
467 (sym->DispId == -1 || sym->DispId == 0) &&
470 sym->DispId = pFD->memid;
473 SysFreeString(bstrName);
476 pITypeInfo->ReleaseFuncDesc(pFD);
480 pITypeInfo->Release();
666 TPointF * lpptfContainer, DWORD flags)
680 int xPixPerInch = ::GetDeviceCaps(dc, LOGPIXELSX);
681 int yPixPerInch = ::GetDeviceCaps(dc, LOGPIXELSY);
683 if (flags & XFORMCOORDS_HIMETRICTOCONTAINER) {
687 else if (flags & XFORMCOORDS_CONTAINERTOHIMETRIC) {
700 return ResultFromScode(E_NOTIMPL);
718 (VOID*)
this, ClassInfo.GetTypeInfo(),
719 (VOID*)
this, ClassInfo.GetTypeInfo(),
1047 if (SUCCEEDED(ocPart->
QueryInterface(IID_IBControl, (LPVOID *)&CtrlI))) {
1067 return ForwardEvent(
int(ambientMsg), &value) ? value : def;
1124 short button,
short shift,
1141 short* keyCode,
short shift)
1159 bool* CancelDisplay)
1166 HelpContext, *CancelDisplay);
1212 button, shift, x, y);
1222 button, shift, x, y);
1232 DISPID_MOUSEUP, button, shift, x, y);
1264OcInvokeProc(LPCTSTR libraryName, LPCSTR procName)
1266 HRESULT hr = ResultFromScode (E_FAIL);
1268 HINSTANCE libHandle = LoadLibrary(libraryName);
1269 if (libHandle <= HINSTANCE(HINSTANCE_ERROR))
1273 dllRegProc = (
REGPROC)::GetProcAddress (libHandle, procName);
1278 FreeLibrary(libHandle);
1292 return OcInvokeProc(libraryName,
"DllRegisterServer");
1303 hr = StringFromCLSID (classId, &str);
1305 if (SUCCEEDED(hr)) {
1310 wsprintf (key,
_T(
"CLSID\\%s\\InprocServer32"), temp);
1314 long len =
sizeof(ocxPath);
1318 if (SUCCEEDED(hr)) {
1324 hr = OcInvokeProc(ocxPath,
"DllUnregisterServer");
OLE Automation Class Definitions.
Automation Symbol Table, Command, and Proxy Macro Definitions.
#define EXPOSE_PROPRO_ID(id, cmd, cls, name, doc, help)
#define REQUIRED_ARG(cls, name)
#define DEFINE_AUTOCLASS(cls)
#define EXPOSE_DELEGATE(cls, name, locator)
#define PRECONDITION(condition)
virtual HRESULT _IFUNC GetEventTypeInfo(ITypeInfo **ppTypeInfo)=0
virtual HRESULT _IFUNC GetCtrlDispatch(IDispatch **ppDispatch)=0
virtual HRESULT _IFUNC AmbientChanged(DISPID dispid)=0
virtual HRESULT _IFUNC SetEventDispatch(IDispatch *)=0
virtual HRESULT _IFUNC GetEventIID(IID *iidEvent)=0
IBSite – Supported by container apps for each linked/embedded object.
TUnknown * CreateAutoObject(TObjectDescriptor obj, TServedObject &app, IUnknown *outer=0)
Creates a TServedObject helper which implements IDispatch on behalf of the class described via the 'o...
TAutoSymbol * Lookup(TCHAR *name, owl::TLangId lang, short symFlags, long &id)
bool AutoIds
generate ID's automatically if true (default)
TAutoSymbol * FindId(long id, ObjectPtr &objptr)
short GetArgCount(TAutoSymbol &sym)
const std::type_info & GetTypeInfo() const
Automation argument stack abstraction.
Based on reference counted TString with added automation functionality.
void Init(int index, ITypeInfo *typeInfo)
TEventEntry & operator[](int index)
owl::uint GetCount() const
TEventList(ITypeInfo *typeInfo)
HRESULT BOleComponentCreate(IUnknown **retIface, IUnknown *outer, owl::uint32 idClass)
Create a BOle helper for one of our OC objects in this app.
TOcRegistrar & GetRegistrar()
OC Control Event class for standard control events.
long MouseUp(short Button, short Shift, long X, long Y)
long MouseDown(short Button, short Shift, long X, long Y)
HRESULT CustomEvent(long *args)
long KeyUp(short *KeyCode, short Shift)
long ErrorEvent(short number, TAutoString Description, SCODE SCode, TAutoString Source, TAutoString HelpFile, long helpContext, bool *CancelDisplay)
TUnknown * CreateAutoObject(const void *obj, TAutoClass &clsInfo)
HRESULT ForwardClickEvent(owl::uint msg, DISPID id)
long KeyDown(short *KeyCode, short Shift)
HRESULT ForwardKeyEvent(owl::uint msg, DISPID id, short *KeyCode, short Shift)
virtual void InitEventDispatch()
HRESULT ForwardMouseEvent(owl::uint msg, DISPID id, short Button, short Shift, long X, long Y)
long MouseMove(short Button, short Shift, long X, long Y)
Class representing an embedded control within a document.
TOcControlEvent * pEvents
TEventList * GetEventList() const
owl::TString & GetUserName()
bool Init(TOcInitInfo *initInfo, owl::TRect pos)
HRESULT QueryObject(const IID &iid, void **iface)
Callback from TUnknown's implementation of QueryInterface.
HRESULT _IFUNC TransformCoords(owl::TPointL *lpptlHimetric, owl::TPointF *lpptfContainer, DWORD flags)
bool InitObj(TOcInitInfo *initInfo)
Perform common ctor initialization.
TServedObject * pIExtended
bool FillEventList()
Retrieves a list of events generated by this control.
ITypeInfo * GetEventTypeInfo()
Retrieves the ITypeInfo the 'default source' event object of this control.
HRESULT _IFUNC OnPropertyRequestEdit(DISPID dispid)
IDispatch * GetCtlDispatch()
Retrieves the primary IDispatch of the control.
HRESULT _IFUNC OnPropertyChanged(DISPID dispid)
IDispatch * GetParent()
Retrieves the extended IDispatch (exposing extended properties).
TOcView * GetActiveControlView()
IBControl * GetBControlI()
void SetUserName(owl::TString &name)
Extended property support.
HRESULT _IFUNC OnControlFocus(BOOL fGotFocus)
Event support.
TOcControl(TOcDocument &document, int id=0, TOcControlEvent *pEv=nullptr)
Construct a new part with a given temp id.
TUnknown * CreateAutoObject(const void *obj, TAutoClass &clsInfo)
void SetHeight(long Value)
void SetWidth(long Value)
OC Document class, holds parts & is a owner of views.
TOcPartCollection & GetParts()
TOcView * GetActiveView()
virtual bool Init(TOcInitInfo *initInfo, owl::TRect pos)
Perform common ctor initialization.
void UpdateRect()
Set part to the new rect given in logical units.
TOcDocument & OcDocument
The OC document we are imbeded in.
owl::uint16 Flags
Is this part Selected/Visible/Active/ALink?
TOcStorage * Storage
The storage we are in.
virtual bool InitObj(TOcInitInfo *initInfo)
HRESULT QueryObject(const IID &iid, void **iface)
Callback from TUnknown's implementation of QueryInterface.
bool Activate(bool activate)
IUnknown * BPart
Our corresponding helper object & interfaces.
void SetPos(const owl::TPoint &pos)
Set part to the new position given in logical units.
void SetSize(const owl::TSize &size)
Set part to the new size given in logical units.
TOcPart(TOcDocument &document, int id=0)
Construct a new part with a given temp id Must call Init method to complete initialization.
void Rename()
Rename the embed site for linking.
HRESULT _IFUNC QueryInterface(const GUID &iid, void **iface)
The TOcView partner is a container (viewer) of a given (server/client) document.
TOcDocument & OcDocument
Our OC document object.
friend class _ICLASS TOcPart
HRESULT QueryObject(const IID &iid, void **iface)
Callback from TUnknown's implementation of QueryInterface.
TOcPart * GetActivePart()
bool ActivatePart(TOcPart *part)
Activate a given part.
HRESULT _IFUNC QueryInterface(const GUID &iid, void **iface)
TOcView(TOcDocument &doc, TOcContainerHost *ch, TOcServerHost *sh, owl::TRegList *regList=0, IUnknown *outer=0)
New, interface constructor.
TOcApp & OcApp
Our OC application object.
owl::TResult ForwardEvent(int eventId, const void *param)
The TOcxView partner is a container (viewer) of a given (server/client) document.
void SetAmbUserMode(bool Mode)
HRESULT QueryObject(const IID &iid, void **iface)
void SetUserMode(bool Mode)
void SetAmbDisplayName(owl::TString &Name)
TOcxView(TOcDocument &doc, owl::TRegList *regList=0, IUnknown *outer=0)
TOcxView Class Implementation.
long GetAmbientValue(long AmbientMsg, long Default)
void SetAmbTextAlign(short Align)
void SetAmbMessageReflect(bool MsgRef)
void SetDisplayAsDefault(bool Disp)
void SetMessageReflect(bool MsgRef)
void SetScaleUnits(owl::TString &ScaleUnits)
void SetAmbShowGrabHandles(bool Handles)
bool GetShowGrabHandles()
bool GetSupportsMnemonics()
void SetBackColor(long Color)
void SetAmbForeColor(long Color)
TServedObject * pIAmbients
void SetAmbFont(IDispatch *pFontDisp)
void AmbientChanged(DISPID dispid)
void SetShowGrabHandles(bool Handles)
void SetLocaleID(long LocaleId)
owl::TString & GetDisplayName()
void SetAmbShowHatching(bool Hatch)
void SetAmbSupportsMnemonics(bool Mnem)
void SetAmbLocaleID(long LocaleId)
void SetAmbUIDead(bool Dead)
void SetAmbScaleUnits(owl::TString &ScaleUnits)
void SetAmbBackColor(long Color)
void SetSupportsMnemonics(bool Mnem)
owl::TString & GetScaleUnits()
void SetDisplayName(owl::TString &Name)
void SetFont(IDispatch *pFontDisp)
void SetAmbDisplayAsDefault(bool Disp)
bool GetDisplayAsDefault()
owl::TString * pBlankString
void SetTextAlign(short Align)
void SetShowHatching(bool Hatch)
void SetForeColor(long Color)
void SetUIDead(bool Dead)
OLE object exposed for automated access of internal object.
owl::ulong _IFUNC AddRef()
HRESULT QueryObject(const IID &iid, void **iface)
owl::ulong _IFUNC Release()
TAutoClass * Class
class of which object is an instance
Standard implementation of a controlling IUnknown for an object, to be inherited with other COM inter...
static void Check(HRESULT stat, TError err, LPCTSTR msg=0)
TPointF is similar to TPoint, but uses floating variables rather than integers.
TPoint is a support class, derived from tagPOINT.
TPointL is similar to TPoint, but uses long rather than int variables.
TRect is a mathematical class derived from tagRect.
static auto GetClassesRoot() -> TRegKey &
Special predefined root key used by shell and OLE applications (HKEY_CLASSES_ROOT).
A registration parameter table, composed of a list of TRegItems.
The tagSIZE struct is defined as.
Reference to reference counted string object TUString Lightweight reference object consisting of a po...
Include for OC, gets common headers when precompiled headers are enabled.
Object Component Framework (COM encapsulation).
HRESULT(PASCAL *) REGPROC()
EXPOSE_PROPRW_ID(DISPID_AMBIENT_BACKCOLOR, BackColor, TAutoLong, _T("!BackColor"), _T("@BackColor_"), 0) EXPOSE_PROPRW_ID(DISPID_AMBIENT_FORECOLOR
RAYK - help contexts?
const owl::uint16 tfNormal
bool HRSucceeded(HRESULT hr)
@ asAnyCommand
any command: method, property get/set, build
HRESULT OcRegisterControl(TCHAR *ocxPath)
END_AUTOCLASS(TOcxView, tfNormal, _T("TOcxView"), _T("@TOcxView_"), 0) EXPOSE_PROPRO_ID(0x80010008L
TOcPartCollection::Iterator TOcPartCollectionIter
const BCID cidBOleControl
HRESULT OcUnregisterControl(CLSID ClassId)
EXPOSE_METHOD_ID(DISPID_DBLCLICK, DblClick, TAutoLong, _T("!DblClick"), _T("@DblClick_"), 0) EXPOSE_METHOD_ID(DISPID_MOUSEDOWN
TAppDescriptor * GetAppDescriptor()
Definition of TOcApp application connection class.
#define MAP_LOGHIM_TO_PIX(hiMetric, pixelsPerInch)
#define MAP_PIX_TO_LOGHIM(pixel, pixelsPerInch)
Definition of TOcControl class - Proxy object representing a control in.
interface _ICLASS ITypeInfo
Definition of TOcDocument Class.
Definition of TOcStorage & TOcStream classes.
Definition of Compound Document TOcView Class.
#define OC_AMBIENT_GETLOCALEID
#define OC_AMBIENT_GETFONT
#define OC_AMBIENT_GETBACKCOLOR
#define OC_AMBIENT_SETBACKCOLOR
#define OC_AMBIENT_SETFONT
#define OC_AMBIENT_SETSUPPORTSMNEMONICS
#define OC_AMBIENT_SETFORECOLOR
#define OC_AMBIENT_SETUSERMODE
#define OC_CTRLEVENT_DBLCLICK
#define OC_CTRLEVENT_MOUSEDOWN
#define OC_AMBIENT_SETSHOWHATCHING
#define OC_AMBIENT_GETUIDEAD
#define OC_CTRLEVENT_PROPERTYREQUESTEDIT
#define OC_AMBIENT_SETDISPLAYNAME
#define OC_AMBIENT_SETMESSAGEREFLECT
#define OC_AMBIENT_GETTEXTALIGN
#define OC_AMBIENT_SETSCALEUNITS
#define OC_CTRLEVENT_FOCUS
#define OC_AMBIENT_SETDISPLAYASDEFAULT
#define OC_AMBIENT_SETSHOWGRABHANDLES
#define OC_AMBIENT_GETSHOWHATCHING
#define OC_AMBIENT_GETSHOWGRABHANDLES
#define OC_CTRLEVENT_MOUSEMOVE
#define OC_AMBIENT_SETLOCALEID
#define OC_AMBIENT_SETUIDEAD
#define OC_AMBIENT_GETMESSAGEREFLECT
#define OC_AMBIENT_GETUSERMODE
#define OC_CTRLEVENT_KEYDOWN
#define OC_CTRLEVENT_MOUSEUP
#define OC_CTRLEVENT_CLICK
#define OC_AMBIENT_SETTEXTALIGN
#define OC_AMBIENT_GETDISPLAYNAME
#define OC_CTRLEVENT_KEYUP
#define OC_AMBIENT_GETDISPLAYASDEFAULT
#define OC_CTRLEVENT_CUSTOMEVENT
#define OC_VIEWTRANSFORMCOORDS
#define OC_AMBIENT_GETSCALEUNITS
#define OC_AMBIENT_GETSUPPORTSMNEMONICS
#define OC_CTRLEVENT_PROPERTYCHANGE
#define OC_AMBIENT_GETFORECOLOR
#define OC_CTRLEVENT_ERROREVENT
bool TestFlag(owl::uint16 mask) const
Base struct for all control event messages.