OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
autodefs.h
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectComponents
3// Copyright (c) 1994, 1996 by Borland International, All Rights Reserved
4/// \file
5/// OLE Automation Class Definitions
6//----------------------------------------------------------------------------
7
8#if !defined(OCF_AUTODEFS_H)
9#define OCF_AUTODEFS_H
10
11#include <owl/private/defs.h>
12#if defined(BI_HAS_PRAGMA_ONCE)
13# pragma once
14#endif
15
16#include <ocf/defs.h>
17#include <owl/lclstrng.h> // TLocaleString and TRegItem/TRegList
18#include <owl/string.h> // TString and TUString
19#include <ocf/oleutil.h>
20
21#if !defined(_OLECTL_H_)
22# if defined(__BIVBX_H) && !defined(NO_VBX_PICTURES)
23# error BIVBX.H LPPICTURE is incompatible with OLECTL.H - define NO_VBX_PICTURES
24# else
25# define NO_VBX_PICTURES // Make sure we're BIVBX's compatible
26# include <olectl.h> // Ole Controls definitions
27# endif
28#endif
29
30
31
32namespace ocf {
33
34//
35// Class modifier for inherited classes or members within user C++ classes
36// if ambient class model is not used, this macro must be defined to match
37//
38#if !defined(_AUTOCLASS)
39# define _AUTOCLASS
40#endif
41
42//
43// Forward class references
44//
47class _ICLASS TAppDescriptor; // defined in appdesc.h
50class TAutoCreator;
51class TAutoCommand;
52struct TAutoSymbol;
53class TAutoString;
54class TAutoStack;
55class TAutoVal;
56class TXAuto;
57class TAutoEnum;
58
59_OCFFUNC(const void *) DynamicCast(const void * obj, const std::type_info& src,
60 const std::type_info& dst);
61
62_OCFFUNC(const void *) MostDerived(const void * obj, const std::type_info& src);
63//
64// Global function to invalidate external references, class model-independent
65//
66_OCFFUNC(void) SendObituary(const void * obj, const std::type_info& typeInfo);
67
68//----------------------------------------------------------------------------
69// Automation typedefs
70//
71
72typedef unsigned long TLocaleId; // locale ID - same as NT LCID
73
74class _AUTOCLASS TAutoBase { // default base for automatable objects
75 public:
76 virtual ~TAutoBase();// only member is virtual destructor for unregistration
77};
78
79class _AUTOCLASS TAutoDetach { // default base for detach notification objects
80 protected:
81 void Notify(int offset, const std::type_info& typeInfo); // sends obituary
82}; // the size of this object must be 0 to not affect enclosing class
83
84typedef void* ObjectPtr; // generic opaque object pointer
85
86//
87// Generic conversion function for changing between inherited classes
88
89//
90template <class T, class B> struct TTypeConvert {
91 static ObjectPtr Cast(ObjectPtr from) { return
92 reinterpret_cast<ObjectPtr>( dynamic_cast<T*>(reinterpret_cast<B*>(from)));
93 }
94};
95
97typedef TAutoCommand* (*TAutoCommandBuild)(ObjectPtr obj,int attr,TAutoStack&);
98typedef TAutoCommand* (*TAutoCommandBuildDtr)(ObjectPtr obj, int attr);
99typedef TAutoIterator* (*TAutoIteratorBuild)(ObjectPtr obj,
100 TAutoCreator& creator,
101 IUnknown* owner, owl::TLangId lang);
102typedef IUnknown& (*TAggregator)(ObjectPtr obj, TUnknown& inner);
103
104#if defined(BI_COMP_BORLANDC)
105extern "C" const GUID __cdecl IID_TServedObject;
106#else
107EXTERN_C const GUID IID_TServedObject; // check it !!!!!!!!!!!!!!!!!!!!!!!!
108#endif
109
110//
111/// \class TXAuto
112// ~~~~~ ~~~~~~
113/// Automation exception object
114//
116 public:
130 TXAuto(TError err);
131 void Throw();
132 static void Raise(TError err);
133
134 public:
136};
137
138//----------------------------------------------------------------------------
139// TAutoType, TAutoClass - automation type/class descriptor
140//
141
143 owl::uint16 GetType() const {return Type;}
145};
146
148 public:
149 TAutoClass(TAutoSymbol* table, TAutoSymbol* classSymbol,
150 const std::type_info& typeInfo, TAggregator aggregator=0);
151 ~TAutoClass();
152
153 short CountCommands(); // forces counts to be set on first call
154 TAutoSymbol* Lookup(LPTSTR name, owl::TLangId lang, short symFlags, long & id);
155 TAutoSymbol* LookupArg(LPTSTR name, owl::TLangId lang, TAutoSymbol* cmd,
156 long & retid);
157 TAutoSymbol* FindId(long id, ObjectPtr& objptr);
158 TAutoSymbol* FindFunction(unsigned index, MEMBERID& retId);
159 TAutoSymbol* FindVariable(unsigned index, MEMBERID& retId);
160 TXAuto::TError Dispatch(ObjectPtr obj, TAutoCreator& creator,
161 TUnknown& owner, int attr, TAutoStack& args,
162 TAutoVal* retval);
163 TAutoSymbol* GetTable() const;
164 TAutoSymbol* GetClassSymbol() const;
165 short GetArgCount(TAutoSymbol& sym);
166 TAutoCommandBuildDtr GetDestructor() const;
167 const std::type_info& GetTypeInfo() const;
168 LPCTSTR GetName(owl::TLangId lang = owl::TLocaleString::UserDefaultLangId) const;
169 LPCTSTR GetDoc (owl::TLangId lang = owl::TLocaleString::UserDefaultLangId) const;
170 unsigned long GetHelpId() const;
171 unsigned short GetTypeFlags() const;
172 int GetImplTypeFlags() const;
173 unsigned short GetCoClassFlags() const;
174 TAggregator GetAggregator() const;
175 IUnknown& Aggregate(ObjectPtr obj, TUnknown& inner);
176
177 protected:
178 TAggregator Aggregator; ///< aggregator function for C++ COM classes
179 short CommandCount; ///< command count including bases, 0 if uncounted
180 short FunctionCount; ///< number of symbols exposed as typelib functions
181 short VariableCount; ///< number of symbols exposed as typelib variables
182 bool AutoIds; ///< generate ID's automatically if true (default)
183 TAutoSymbol* Table; ///< pointer to array of symbol entries
184 TAutoSymbol* ClassSymbol;///< pointer to class symbol (terminator)
185 const std::type_info& TypeInfo;///< for validating type of data pointers
186 friend class TServedObject;
187
188 private:
189 struct TAutoClassRef { ///< element used for array of TAutoClass objects
190 TAutoClass* Class;
191 int GuidOffset;
192 };
193 struct TExtLink; // fwd declaration
194 static struct TClassList { ///< module-static TAutoClass data
195 int CountAutoClasses(); // walks list in attatched DLLs
196 TAutoClassRef* MergeAutoClasses(TAutoClassRef* array);
197 TAutoClass* List; ///< chain of autoclasses in THIS module
198 int Count; ///< count of classes in THIS module
199 TExtLink* Link; ///< chain of TAutoClass data for loaded DLLs
200 } ClassList;
201 struct TExtLink { // doubly-linked list of external DLL data
202 TExtLink(TClassList* list, HINSTANCE module);
203 ~TExtLink();
204 TClassList* Classes;
205 HINSTANCE Module; // module handle if dynmaically loaded, else 0
206 TExtLink* Next;
207 TExtLink** Prev;
208 };
209 TAutoClass* NextClass; ///< link to next class
210 friend struct TExtLink; ///< access to ClassList
211 friend struct TClassList; ///< access to TAutoClassRef
212 friend class TAppDescriptor; ///< access to linkage information
213 friend class _ICLASS TTypeLibrary;///< access to TAutoClassRef
214 friend class _ICLASS TCoClassInfo;///< access to TAutoClassRef
215 friend class _ICLASS TOcControlEvent; ///< access to AutoIds bool
216};
217
218//----------------------------------------------------------------------------
219// TAuto(type) automation datatype encapsulations
220//
221
222//
223// Class to implement assignent of void to TAutoVal
224//
228
229//
230// Class to implement assignment of VT_ERROR/DISP_E_PARAMNOTFOUND
231// (i.e. Optional arguments) to TAutoVal
232//
234 //
235 // Dummy structure
236};
237
238//
239// Wrapper class to disambiguate automation date type from double
240//
241# if defined(BI_COMP_BORLANDC)
242# pragma warn -inl
243# endif
245 TAutoDate() : Date(0) {}
246 TAutoDate(double d) : Date(d) {}
247 operator double() { return Date; }
248 double Date; // same as OLE DATE
250};
251
252//struct TAutoCurrency : public CY {
256
257 operator CY& () {return *reinterpret_cast<CY*>(this);}
258
260};
261
264
265//
266// The following types do not hold data, but only provide static type codes
267//
273struct _OCFCLASS TAutoUnknown { static TAutoType ClassInfo; }; // for raw IUnknown*
274struct _OCFCLASS TAutoDispatch { static TAutoType ClassInfo; }; // for raw IDispatch*
286//#if (MAXINT==MAXSHORT)
287// typedef TAutoShort TAutoInt;
288// typedef TAutoShortRef TAutoIntRef;
289//#else
292//#endif
293
294//----------------------------------------------------------------------------
295/// Attribute flags for automation symbols and command objects
296//
298 asAnyCommand = 0x0017, ///< any command: method, property get/set, build
299 asOleType = 0x0007, ///< method or property exposed for OLE
300 asMethod = 0x0001, ///< method (same as OLE INVOKE_FUNC)
301 asGet = 0x0002, ///< returns property value (INVOKE_PROPERTYGET)
302 asIterator = 0x000A, ///< iterator property (_NewEnum)
303 asSet = 0x0004, ///< set property value (INVOKE_PROPERTYSET)
304 asGetSet = 0x0006, ///< can get or set property(...GET + ...SET)
305 asBuild = 0x0010, ///< contructor command (unsupported by OLE 2.01)
306 asFactory = 0x0020, ///< for creating objects or class determination
307 asClass = 0x0040, ///< extension to another class symbol table
308 asArgument = 0x0080, ///< property returning an object
309 asNotTerminator = 0x00FF, ///< any symbol except terminator with class info
310
311 asBindable = 0x0400, ///< sends OnChanged notification
312 asRequestEdit = 0x0800, ///< sends OnRequest edit before change
313 asDisplayBind = 0x1000, ///< user-display of bindable
314 asDefaultBind = 0x2000, ///< this property only is the default (redundant)
315 asHidden = 0x4000, ///< not visible to normal browsing
316 asPersistent = 0x8000, ///< property is persistent
317};
318
319//
320/// Automation datatypes and flags - same as OLE 2 definitions
321//
323 atVoid = VT_EMPTY, // 0x0000, // void
324 atNull = VT_NULL, // 0x0001, // SQL style Null
325 atShort = VT_I2, // 0x0002, // 2 byte signed int
326 atLong = VT_I4, // 0x0003, // 4 byte signed int
327 atFloat = VT_R4, // 0x0004, // 4 byte real
328 atDouble = VT_R8, // 0x0005, // 8 byte real
329 atCurrency = VT_CY, // 0x0006, // currency
330 atDatetime = VT_DATE, // 0x0007, // datetime as double
331 atString = VT_BSTR, // 0x0008, // String preceeded by length
332 atObject = VT_DISPATCH, // 0x0009, // IDispatch*
333 atError = VT_ERROR, // 0x000A, // SCODE
334 atBool = VT_BOOL, // 0x000B, // True=-1, False=0
335 atVariant = VT_VARIANT, // 0x000C, // VARIANT*
336 atUnknown = VT_UNKNOWN, // 0x000D, // IUnknown*
337 atByte = VT_UI1, // 0x0011, // byte, unsigned char
338 atArray = VT_ARRAY, //
339 atObjectDesc = 0x001D, // object precursor state (internal use only)
340 atLoanedBSTR = 0x001A, // BSTR owned by TUString (internal use only)
341 atTypeMask = 0x001F, // base type code without bit flags
342 atOLE2Mask = 0x601F, // type code with bit flags
343};
345const owl::uint16 atByRef = 0x4000;
346const owl::uint16 atEnum = 0x1000; // non-OLE, enumeration for data of a type
347const owl::uint16 atAutoClass= 0x0800; // non-OLE, class object is a TAutoClass
348
349//----------------------------------------------------------------------------
350// Automated class type info flags - corresponding to OLE 2.02 definitions
351// flags set in END_AUTOCLASS, END_AUTOAGGREGATE, END_AUTOEVENTCLASS macros
352//
353
354//
355// Flags set on any autoclass, but apply only to enclosing coclass type info.
356// Autoclasses with any of these bits set will be members of generated coclass.
357// These flags from all autoclasses are combined to form the coclass type flags
358
359//
360const owl::uint16 tfAppObject = 1; // TYPEFLAG_FAPPOBJECT, set on COCLASS
361const owl::uint16 tfCanCreate = 2; // TYPEFLAG_FCANCREATE, set on COCLASS
362const owl::uint16 tfLicensed = 4; // TYPEFLAG_FLICENSED, set on COCLASS
363const owl::uint16 tfPredeclared = 8; // TYPEFLAG_FPREDECLID, set on COCLASS
364const owl::uint16 tfControl = 32; // TYPEFLAG_FCONTROL, set on COCLASS
366
367//
368// Flags set on any autoclass, but used when class is a member of a coclass.
369// Autoclasses with any of these bits set will be members of generated coclass.
370// Flags from each class are set on the corresponding interfaces in the coclass
371
372//
373const owl::uint16 tfDefault = (1<<12); // IMPLTYPEFLAG_FDEFAULT << 12
374const owl::uint16 tfEventSource = (2<<12); // IMPLTYPEFLAG_FSOURCE << 12
375const owl::uint16 tfRestricted = (4<<12); // IMPLTYPEFLAG_FRESTRICTED << 12
377
378//
379// Flags set on individual autoclasses, transferred to corresponding __OWL_TYPEINFOs
380
381//
382const owl::uint16 tfHidden = 16; // TYPEFLAG_FHIDDEN
383const owl::uint16 tfNonextensible = 128; // TYPEFLAG_FNONEXTENSIBLE
385
386//
387// Flags defined by OLE, but not applicable to dispatch interfaces
388
389//
390const owl::uint16 tfDual = 64; // TYPEFLAG_FDUAL
391const owl::uint16 tfAutomation = 256; // TYPEFLAG_FOLEAUTOMATION
392
393//
394// Default typeflags value for autoclass not exposed as part of the coclass
395
396//
397const owl::uint16 tfNormal = 0; // automated classes not at app level
398
399//
400/// \class TAutoSymbol
401// ~~~~~ ~~~~~~~~~~~
402/// Symbol table element
403//
405 owl::TLocaleString Name; ///< name of symbol, initially untranslated
406 owl::TLocaleString Doc; ///< documentation string, initially untranslated
407 owl::uint32 Attr; ///< attributes: enum AutoSymFlag, as???? (could be owl::uint16)
408 union {
409 long DispId; ///< reserved dispatch ID, if not 0
410 short SymCount; ///< asClass only: symbol count, 0 = uncounted yet
411 unsigned short TypeFlags; ///< class symbol only (terminator)
412 };
413 TAutoType* Type; ///< pointer to class/type/enum descriptor
414 union {
415 TAutoCommandBuild Build; ///< asAnyCommand only: address of command builder
416 TAutoIteratorBuild BuildIter; ///< asIterator only: address of iterator builder
417 TAutoSymTypeConvert Convert; ///< asFactory/asClass: function to perform cast
418 TAutoCommandBuildDtr BuildDtr; ///< terminator only: destructor command builder
419 void* DefaultArg; ///< asArgument: default value, extends to 8 bytes
420 };
421 owl::ulong HelpId; ///< help context ID, not for asArgument
422
423 // Inline data member accessor functions
424 //
425 void SetFlag(owl::uint16 mask);
426 void ClearFlag(owl::uint16 mask);
427 bool TestFlag(owl::uint16 mask) const;
428 owl::uint16 GetFlags() const;
429 bool IsEnum() const;
430 bool IsByRef() const;
431 bool IsArray() const;
432 bool IsIterator() const;
433 bool IsTerminator() const;
434 owl::uint16 GetDataType() const;
435 TAutoClass* GetClass() const;
436 TAutoEnum* GetEnum() const;
437
438 // Inline static functions solely to provide type-safety initializing symbols
439 //
440 static TAutoCommandBuild InitTypeConvert(TAutoSymTypeConvert f);
441 static TAutoCommandBuild InitAutoIterator(TAutoIteratorBuild f);
442 static TAutoCommandBuild InitAutoDestructor(TAutoCommandBuildDtr f);
443};
444
445//
446/// \struct TObjectDescriptor
447// ~~~~~~ ~~~~~~~~~~~~~~~~~
448/// Precursor to TServedObject containing object info
449/// \note Cannot have a constructor and must limit to 8 bytes for TAutoVal union
450//
451struct _OCFCLASS TObjectDescBase { ///< ONLY for use when storing in TAutoVal union
452 const void* Object; ///< pointer to C++ object
453 TAutoClass* Class; ///< class descriptor, contains type info
454 const void* MostDerived() {
455 return ocf::MostDerived(Object, Class->GetTypeInfo());
456 }
457};
458
459// Double check size of TObjectDescBase
460//
461#if defined(BI_COMP_BORLANDC) && !defined(__clang__)
462 #if sizeof(TObjectDescBase) > 8
463 #error Sizeof TObjectDescBase must be 8 bytes - it is a TAutoVal union member
464 #endif
465#endif
466
467//
468// struct TObjectDescriptor
469// ~~~~~~ ~~~~~~~~~~~~~~~~~
471 enum TDestruct { ///< behavior when an automation helper is freed
472 Quiet = 0, ///< automation object quietly goes away without notice
473 Delete = 1, ///< automation object deletes the C++ object serviced
474 PostQuit = 2 ///< automation object posts a quit message to application
475 };
477 TObjectDescriptor(const void* obj, TAutoClass& classobj,
478 TDestruct destruct = Quiet)
479 { Object = obj; Class = &classobj; Destruct = destruct; }
480 private:
481 TObjectDescriptor() {} // uninitialized struct
482 friend class TAutoClass; // restrict access to uninitialized constructor
483 friend class TAutoIterator;
484};
485
486
487//
488/// \class TAutoString
489// ~~~~~ ~~~~~~~~~~~
490/// Based on reference counted TString with added automation functionality
491//
493 public:
494 TAutoString(const char* s = 0) : owl::TString(s) {}
495 TAutoString(const wchar_t* s) : owl::TString(s) {}
496 TAutoString(BSTR s, bool loan) : owl::TString(s) {}
499 explicit TAutoString(TAutoVal& val);
500 TAutoString(const TAutoString& src) : owl::TString(src.S) {++*S;}
501
502 TAutoString& operator =(const char* s) {S = S->Assign(s); return *this;}
503 TAutoString& operator =(const TAutoString& s) {S = S->Assign(*s.S); return *this;}
504 TAutoString& operator =(char* s) {S = S->Assign(s); return *this;}
505 TAutoString& operator =(const wchar_t* s) {S = S->Assign(s); return *this;}
506 TAutoString& operator =(wchar_t* s) {S = S->Assign(s); return *this;}
507 TAutoString& operator =(TAutoVal& val);
508
509 static TAutoType ClassInfo; // automation type code
510};
511
512
513//
514/// \class TAutoVal
515// ~~~~~ ~~~~~~~~
516/// Automation data element (same data as OLE/BASIC VARIANT)
517//
518/// This class simply duplicates and adds access methods to the system VARIANT
519/// Data members or virtual functions cannot be added.
520/// We rely on the fact that we can cast a VARIANT safely to/from a TAutoVal.
521//
522
523# if defined(BI_COMP_BORLANDC)
524# pragma warn -inl
525# endif
527 public:
528
529 // Default constructors/assignment operators/destructors
530 //
531 TAutoVal();
532 TAutoVal(const TAutoVal& src);
533 const TAutoVal& operator =(const TAutoVal& src);
534 ~TAutoVal();
535
536 // Constructors to create a TAutoVal/VARIANT from a C++ type
537 //
538 TAutoVal(unsigned char i){ *this = i; };
539 TAutoVal(signed char i){ *this = i; };
540 TAutoVal(char i){ *this = i; };
541 explicit TAutoVal(unsigned char* p){ *this = p; };
542 explicit TAutoVal(signed char* p){ *this = p; };
543 explicit TAutoVal(char* p){ *this = p; };
544 TAutoVal(const char* p){ *this = p; };
545 TAutoVal(int i){ *this = i; };
546 TAutoVal(int* p){ *this = p; };
547 TAutoVal(unsigned int i){ *this = i; };
548 TAutoVal(unsigned int* p){ *this = p; };
549 TAutoVal(unsigned short i){ *this = i; };
550 TAutoVal(unsigned short* p){ *this = p; };
551 TAutoVal(long i){ *this = i; };
552 TAutoVal(long* p){ *this = p; };
553 TAutoVal(unsigned long i){ *this = i; };
554 TAutoVal(unsigned long* p){ *this = p; };
555 TAutoVal(short i){ *this = i; };
556 TAutoVal(short* p){ *this = p; };
557 TAutoVal(float i){ *this = i; };
558 TAutoVal(float* p){ *this = p; };
559 TAutoVal(double i){ *this = i; };
560 TAutoVal(double* p){ *this = p; };
561 TAutoVal(void* p){ *this = p; };
562 TAutoVal(owl::TBool i){ *this = i; };
563 TAutoVal(owl::TBool* p){ *this = p; };
564 TAutoVal(const owl::tstring& s){ *this = s; };
565#pragma warn -inl
566 TAutoVal(TAutoString s){ *this = s; };
567#pragma warn .inl
568 TAutoVal(owl::TString s){ *this = s; };
569 TAutoVal(TAutoCurrency i){ *this = i; };
570 TAutoVal(TAutoCurrency* p){ *this = p; };
571 TAutoVal(TAutoDate i){ *this = i; };
572 TAutoVal(TAutoDate* i){ *this = i; };
573 TAutoVal(IDispatch* ifc){ *this = ifc; };
574 TAutoVal(IDispatch** ifc){ *this = ifc; };
575 TAutoVal(IUnknown* ifc){ *this = ifc; };
576 TAutoVal(IUnknown** ifc){ *this = ifc; };
577 TAutoVal(IPictureDisp* ifc){ *this = ifc; };
578 TAutoVal(IFontDisp* ifc){ *this = ifc; };
579 TAutoVal(VARIANT& v){ *this = v; };
580 TAutoVal(const TNoArg& n){ *this = n; };
581
582 // The following constructors are added to complement the functionality of
583 // TAutoVal
584 TAutoVal(BSTR* p){ *this = p; };
585 TAutoVal(TBSTR* p){ *this = p; };
586 TAutoVal(TAutoVal* p){ *this = p; };
587 TAutoVal(LARGE_INTEGER v){ *this = v; };
588 TAutoVal(ULARGE_INTEGER v){ *this = v; };
589 TAutoVal(SAFEARRAY* v) { *this = v; }
590#if defined(_WIN64)
591 TAutoVal(ULONG_PTR v){ *this = v; };
592#endif
593
594 // Operators to extract a C++ type from a TAutoVal/VARIANT
595 //
596 operator unsigned char();
597 operator signed char();
598 operator char();
599 operator unsigned char*();
600 operator signed char*();
601 operator char*();
602 operator int();
603 operator int*();
604 operator unsigned int();
605 operator short();
606 operator short*();
607 operator unsigned short();
608 operator unsigned short*();
609 operator long();
610 operator long*();
611 operator unsigned long();
612 operator unsigned long*();
613 operator float();
614 operator float*();
615 operator double();
616 operator double*();
617 operator void*();
618 operator owl::TBool();
619 operator owl::TBool*();
620 operator TAutoCurrency();
621 operator TAutoCurrency*();
622 operator TAutoDate();
623 operator TAutoDate*();
624 operator owl::tstring();
625 operator owl::TUString*();
626 operator owl::TString();
627 operator TAutoString();
628 operator IUnknown*();
629 operator IDispatch*();
630 operator IPictureDisp*();
631 operator IFontDisp*();
632 operator IPictureDisp&();
633 operator IFontDisp&();
634 operator IUnknown&();
635 operator IDispatch&();
636 // The following operators are added to complement the functionality of
637 // TAutoVal
638 operator BSTR();
639 operator BSTR*();
640 operator TBSTR*();
641 operator SAFEARRAY*();
642 operator IUnknown**();
643 operator IDispatch**();
644 operator TAutoVal*();
645 operator LARGE_INTEGER();
646 operator ULARGE_INTEGER();
647#if defined(_WIN64)
648 operator ULONG_PTR();
649#endif
650
651 // Assignment operators to initialize a TAutoVal/VARIANT with the contents
652 // of a instance of a C++ type.
653 //
654 void operator =(unsigned char i);
655 void operator =(signed char i);
656 void operator =(char i);
657 void operator =(unsigned char* p);
658 void operator =(signed char* p);
659 void operator =(char* p);
660 void operator =(const char* p);
661 void operator =(int i);
662 void operator =(int* p);
663 void operator =(unsigned int i);
664 void operator =(unsigned int* p);
665 void operator =(unsigned short i);
666 void operator =(unsigned short* p);
667 void operator =(long i);
668 void operator =(long* p);
669 void operator =(unsigned long i);
670 void operator =(unsigned long* p);
671 void operator =(short i);
672 void operator =(short* p);
673 void operator =(float i);
674 void operator =(float* p);
675 void operator =(double i);
676 void operator =(double* p);
677 void operator =(void* p);
678 void operator =(owl::TBool i);
679 void operator =(owl::TBool* p);
680 void operator =(const owl::tstring& s);
681 void operator =(TAutoString s);
682 void operator =(owl::TString s);
683 void operator =(TAutoCurrency i);
684 void operator =(TAutoCurrency* p);
685 void operator =(TAutoDate i);
686 void operator =(TAutoDate* i);
687 void operator =(IUnknown* ifc);
688 void operator =(IDispatch* ifc);
689 void operator =(IPictureDisp* ifc);
690 void operator =(IFontDisp* ifc);
691 void operator =(VARIANT& v);
692 void operator =(TObjectDescriptor od);
693 void operator =(TAutoVoid );
694 void operator =(const TNoArg& n);
695 // The following operators are added to complement the functionality of
696 // TAutoVal
697 void operator =(BSTR* p);
698 void operator =(TBSTR* p);
699 void operator =(IUnknown** p);
700 void operator =(IDispatch** p);
701 void operator =(TAutoVal* p);
702 void operator =(LARGE_INTEGER v);
703 void operator =(ULARGE_INTEGER v);
704 void operator =(SAFEARRAY* p);
705#if defined(_WIN64)
706 void operator =(ULONG_PTR v);
707#endif
708
709 // Query/Manipulate VARIANT object
710 //
711 int GetDataType() const; // Returns variant type
712 void Init(); // Initializes VARIANT/TAutoVal to 0s
713 void Clear(); // Free refs, set type to atVoid
714 void Restore(); // Revert non-OLE changes to original types
715 void Copy(const TAutoVal& copy);
716 HRESULT ChangeType(VARTYPE type, TAutoVal* src = 0);
717 bool IsRef() const;
718
719 // Retrieve VARIANT object catering for VT_VARIANT|VT_BYREF
720 //
721 TAutoVal* DereferenceVariant();
722
723 void SetLocale(TLocaleId); // Associate locale with appropriate pointers
724 TLocaleId GetLocale() const; // Retrieve locale from appropriate pointers
725 owl::TLangId GetLanguage() const; // Retrieve language from pointer types
726 owl::TString StrVal(); // Returns internal string pointer if atString
727 bool GetObjDesc(TObjectDescriptor&); // Return temp obj info or false
728 SAFEARRAY* GetArray(); // Return array pointer, or 0
729 void* SetByRef(AutoDataType); // Set type, return pointer to data loc
730
731 private:
732
733 // The following members follow the layout of the actual VARIANT type
734 //
735 unsigned short vt;
736 unsigned short Reserved1;
737 unsigned short Reserved2;
738 unsigned short Reserved3;
739 union {
740 unsigned char bVal; // VT_UI1
741 short iVal; // VT_I2
742 long lVal; // VT_I4
743 float fltVal; // VT_R4
744 double dblVal; // VT_R8
745 VARIANT_BOOL boolVal; // VT_BOOL
746 SCODE scode; // VT_ERROR
748 DATE date; // VT_DATE
749 BSTR bstrVal; // VT_BSTR
750 IUnknown* punkVal; // VT_UNKNOWN
751 IDispatch* pdispVal; // VT_DISPATCH
752 SAFEARRAY* parray; // VT_ARRAY
753 unsigned char* pbVal; // VT_BYREF|VT_UI1
754 short * piVal; // VT_BYREF|VT_I2
755 long * plVal; // VT_BYREF|VT_I4
756 float * pfltVal; // VT_BYREF|VT_R4
757 double * pdblVal; // VT_BYREF|VT_R8
758 VARIANT_BOOL * pbool; // VT_BYREF|VT_BOOL
759 SCODE * pscode; // VT_BYREF|VT_ERROR
760 TAutoCurrency* pcyVal; // VT_BYREF|VT_CY
761 DATE * pdate; // VT_BYREF|VT_DATE
762 BSTR * pbstrVal; // VT_BYREF|VT_BSTR
763 IUnknown* * ppunkVal; // VT_BYREF|VT_UNKNOWN
764 IDispatch* * ppdispVal; // VT_BYREF|VT_DISPATCH
765 SAFEARRAY* * pparray; // VT_BYREF|VT_ARRAY
766 VARIANT * pvarVal; // VT_BYREF|VT_VARIANT
767 void * byref; // Generic ByRef
768
769 // The following entries are enhancements to the VARIANT type allowing
770 // OCF to 'carry' additional information. NOTE: These members make it
771 // impractical to have TAutoVal derive from the VARIANT type.
772 //
773 struct { ///< Added locale info for BSTR/IDispatch
774 void* Val;
775 LCID Locale; ///< Unused 4 bytes for pointer types
776 } p;
777
778 struct { ///< Added info when loaned BSTR ownership
779 BSTR Val;
780 owl::TUString* Holder; ///< String holder sharing current BSTR
781 } s;
782
783 TObjectDescBase ObjDesc; ///< Temporary space for returning object
784
785 LARGE_INTEGER hVal; ///< Also support LARGE_INTEGER
786 ULARGE_INTEGER uhVal; ///< Also support ULARGE_INTEGER
787#if defined(_WIN64)
788 ULONG_PTR uptrVal; ///< Also support ULONG_PTR
789#endif
790 };
791
792 void ConvRef(int type);
793};
794# if defined(BI_COMP_BORLANDC)
795# pragma warn .inl
796# endif
797
798
799// Check that TAutoVal is 'size-wise' VARIANT compatible
800//
801#if defined(BI_COMP_BORLANDC) && !defined(__clang__)
802# if sizeof(TAutoVal) != sizeof(VARIANT)
803# Error Sizeof(TAutoVal) must match Sizeof(VARIANT)
804# endif
805#endif
806
807
808//
809/// \class TAutoStack
810// ~~~~~ ~~~~~~~~~~
811/// Automation argument stack abstraction
812//
814 public:
815 enum {SetValue = -3}; // Special arg index for property set value
816 TAutoStack(DISPID dispid, VARIANT* stack, TLocaleId locale,
817 int argcount,
818 int namedcount, long* map, TServedObject* owner);
819 ~TAutoStack();
820 TAutoVal& operator[](int index);
821
822 TAutoSymbol* Symbol; ///< Symbol of method/prop, args follow
823 int CurrentArg; ///< Index of last arg requested by operator[]
826 DISPID DispId;
829 long ErrorCode; ///< Set if TXAuto::xErrorStatus returned
830 LPCTSTR ErrorMsg; ///< Set if TXAuto::xErrorStatus returned
831
832 protected:
834 long* NamedIds;
837};
838
839struct _OCFCLASS TAutoTransfer; // Persistence transfer parameter structure
840
841//
842/// \class TAutoCommand
843// ~~~~~ ~~~~~~~~~~~~
844/// Automation abstract base class for command objects
845//
847 public:
848 TAutoCommand(int attr); // Construtor called from derived classes
849
850 virtual ~TAutoCommand() {}
851 virtual TAutoCommand* Undo(); // generate command for undo stack
852 virtual int Record(TAutoStack& q); // record command and arguments
853 virtual TAutoCommand& Invoke(); // invoke all command processing
854 virtual bool Validate(); // validate parameters
855 virtual void Execute(); // perform action on C++ object
856 virtual long Report(); // check result of execution
857 virtual void Return(TAutoVal& v);// convert return value to variant
858 virtual void Transfer(TAutoTransfer& x); // stream data in or out
859 void Fail(TXAuto::TError);// throw designated exception
860
861 // Non-virtual hook functions
862 //
863 typedef LPCTSTR (*TErrorMsgHook)(long errCode);
864 static TErrorMsgHook SetErrorMsgHook(TErrorMsgHook callback);
865
866 typedef bool (*TCommandHook)(TAutoCommand& cmdObj);
867 static TCommandHook SetCommandHook(TCommandHook callback);
868
869 // inline data member accessor functions
870 //
871 static LPCTSTR LookupError(long errCode);
872 void SetFlag(int mask);
873 void ClearFlag(int mask);
874 bool TestFlag(int mask);
875 bool IsPropSet();
876 TAutoSymbol* GetSymbol();
877 void SetSymbol(TAutoSymbol* sym);
878
879 protected:
880 TAutoSymbol* Symbol; // Symbol entry generating this command
881 int Attr; // Attribute and state flags, asXXXXXX
882};
883extern _OCFDATA(TAutoCommand::TErrorMsgHook) TAutoCommand_ErrorLookup;
884extern _OCFDATA(TAutoCommand::TCommandHook) TAutoCommand_InvokeHook;
885
886//
887// Build function for application Quit command implementation
888//
890
891//----------------------------------------------------------------------------
892// TAutoEnum - automation enumeration descriptor
893//
894
895template <class T> struct TAutoEnumVal {
896 owl::TLocaleString Name; ///< Name of symbol, enumeration text
897 T Val; ///< Enumeration internal value
898};
899
900class TAutoEnum : public TAutoType {
901 public:
902 virtual bool Convert(TAutoVal& txtVal, TAutoVal& numVal) = 0;
903 virtual bool Convert(TAutoVal& numVal, owl::TLangId langId) = 0;
904
905 protected:
906 TAutoEnum(int count, int type);
907 int Count; ///< length of this symbol table
908};
909
910template <class T> class TAutoEnumT : public TAutoEnum {
911 public:
912 TAutoEnumT(TAutoEnumVal<T>* table, int symcount, int type);
913 bool Convert(TAutoVal& txtVal, TAutoVal& numVal);
914 bool Convert(TAutoVal& numVal, owl::TLangId langId);
915
916 protected:
917 TAutoEnumVal<T>* Table; ///< pointer to array of symbol entries
918};
919
920//____________________________________________________________________________
921//
922/// \class TAutoCreator
923/// Object responsible for creating automation COM object
925 public:
928 IUnknown* outer = 0) = 0;
929 virtual IDispatch* CreateDispatch(TObjectDescriptor objDesc,
930 IUnknown* outer = 0) = 0;
931 virtual void Attach(TServedObject& obj) {}
932 virtual void Detach(TServedObject& obj) {}
933};
934
936 public:
938 TUnknown* CreateObject(TObjectDescriptor objDesc, IUnknown* outer = 0);
939 IDispatch* CreateDispatch(TObjectDescriptor objDesc, IUnknown* outer = 0);
940 void Attach(TServedObject& obj);
941 void Detach(TServedObject& obj);
942
943 TAppDescriptor& GetAppDesc() { return AppDesc; }
944 TServedObject* GetAppObject() { return AppObject; }
945
946 protected:
949
950 private:
951 int ObjCount;
952
953 friend class TServedObject;
954};
955
957
959 public:
961 TUnknown* CreateObject(TObjectDescriptor objDesc, IUnknown* outer = 0);
962 IDispatch* CreateDispatch(TObjectDescriptor objDesc, IUnknown* outer = 0);
963};
964
965//----------------------------------------------------------------------------
966/// \class TServedObject
967/// OLE object exposed for automated access of internal object
968//
969
970DECLARE_COMBASES2(TServedCOM, IDispatch, ITypeInfo)
971
972class _ICLASS TServedObject : public TServedCOM {
973 public:
975 IUnknown* outer=0);
977 TServedObject* GetAppObject() {return Creator.AppObject;}
978 TServedObjectCreator& GetCreator() {return Creator;}
979
980 operator IDispatch*();
981
982 void* Object; ///< pointer to C++ object instance, 0 if deleted
983 const void* RootObject; ///< pointer to object of most derived class
984 TAutoClass* Class; ///< class of which object is an instance
986 owl::TLangId ReqLang; ///< language requested by caller
988 Destruct; ///< what to do with C++ object
989
990 // Object reference & lifetime managment
991 // For internal OCF use only
992 //
993 owl::ulong _IFUNC AddRef() {return GetOuter()->AddRef();}
994 owl::ulong _IFUNC Release() {return GetOuter()->Release();}
995 HRESULT _IFUNC QueryInterface(const GUID & iid, void** iface)
996 {return GetOuter()->QueryInterface(iid, iface);}
997
998 protected:
999 // TUnknown overrides
1000 //
1001 HRESULT QueryObject(const IID & iid, void** iface);
1002
1003 private:
1004 IID iidEvent;
1005 TServedObject* Next;
1006 TServedObject** Prev;
1007 // need to access local LANGID for type info, either as member or as global
1008
1009 // IDispatch implementation
1010 HRESULT _IFUNC GetTypeInfoCount(unsigned int* pctinfo);
1011 HRESULT _IFUNC GetTypeInfo(unsigned int itinfo, LCID lcid,
1012 ITypeInfo** pptinfo);
1013 HRESULT _IFUNC GetIDsOfNames(const IID & riid, OLECHAR** rgszNames,
1014 owl::uint cNames, LCID lcid,
1015 DISPID* rgdispid);
1016 HRESULT _IFUNC Invoke(DISPID dispidMember, const IID & riid, LCID lcid,
1017 unsigned short wFlags,
1018 DISPPARAMS* pdispparams,
1019 VARIANT* pvarResult,
1020 EXCEPINFO* pexcepinfo,
1021 unsigned int* puArgErr);
1022
1023 // ITypeInfo implementation
1024 //
1025 HRESULT _IFUNC GetTypeAttr(TYPEATTR** pptypeattr);
1026 HRESULT _IFUNC GetTypeComp(ITypeComp** pptcomp);
1027 HRESULT _IFUNC GetFuncDesc(unsigned int index, FUNCDESC** ppfuncdesc);
1028 HRESULT _IFUNC GetVarDesc(unsigned int index, VARDESC** ppvardesc);
1029 HRESULT _IFUNC GetNames(MEMBERID memid, BSTR* rgbstrNames,
1030 unsigned int cMaxNames,
1031 unsigned int* pcNames);
1032 HRESULT _IFUNC GetRefTypeOfImplType(unsigned int index, HREFTYPE* phreftype);
1033 HRESULT _IFUNC GetImplTypeFlags(unsigned int index, int* pimpltypeflags);
1034 HRESULT _IFUNC GetIDsOfNames(OLECHAR** rgszNames,
1035 unsigned int cNames,
1036 MEMBERID* rgmemid);
1037 HRESULT _IFUNC Invoke(void* pvInstance, MEMBERID memid,
1038 unsigned short wFlags,
1039 DISPPARAMS *pdispparams,
1040 VARIANT *pvarResult,
1041 EXCEPINFO *pexcepinfo,
1042 unsigned int *puArgErr);
1043 HRESULT _IFUNC GetDocumentation(MEMBERID memid,
1044 BSTR* pbstrName,
1045 BSTR* pbstrDocString,
1046 owl::ulong* pdwHelpContext,
1047 BSTR* pbstrHelpFile);
1048 HRESULT _IFUNC GetDllEntry(MEMBERID memid, INVOKEKIND invkind,
1049 BSTR* pbstrDllName,
1050 BSTR* pbstrName,
1051 unsigned short* pwOrdinal);
1052 HRESULT _IFUNC GetRefTypeInfo(HREFTYPE hreftype,
1053 ITypeInfo** pptinfo);
1054 HRESULT _IFUNC AddressOfMember(MEMBERID memid, INVOKEKIND invkind,
1055 void** ppv);
1056 HRESULT _IFUNC CreateInstance(IUnknown* punkOuter, const IID & riid,
1057 void** ppvObj);
1058 HRESULT _IFUNC GetMops(MEMBERID memid, BSTR* pbstrMops);
1059 HRESULT _IFUNC GetContainingTypeLib(ITypeLib** pptlib,
1060 owl::uint* pindex);
1061 void _IFUNC ReleaseTypeAttr(TYPEATTR* ptypeattr);
1062 void _IFUNC ReleaseFuncDesc(FUNCDESC* pfuncdesc);
1063 void _IFUNC ReleaseVarDesc(VARDESC* pvardesc);
1064 HRESULT _IFUNC GetFuncDocFromIndex(unsigned index,
1065 BSTR* retName, BSTR* retDoc,
1066 owl::ulong* retHelpContext,
1067 BSTR* retHelpFile);
1068 // GetVarDocFromIndex and GetDocFromSym are used to by WriteTypeLib to make
1069 // type libraries
1070 HRESULT _IFUNC GetVarDocFromIndex(unsigned index,
1071 BSTR* retName, BSTR* retDoc,
1072 owl::ulong* retHelpContext,
1073 BSTR* retHelpFile);
1074 HRESULT _IFUNC GetDocFromSym(TAutoSymbol* sym,
1075 BSTR* retName, BSTR* retDoc,
1076 owl::ulong* retHelpContext,
1077 BSTR* retHelpFile);
1078 friend class _ICLASS TAppDescriptor; // access to Next,Prev
1079 friend class _ICLASS TOcxView; // access to QueryObject
1080 friend class _ICLASS TOcControl; // access to QueryObject
1081};
1082
1083//----------------------------------------------------------------------------
1084/// \class TDispatch
1085/// lightweight IDispatch implementation for automation controllers
1086//
1087
1088DECLARE_COMBASES1(TDispatchCOM, IDispatch)
1089
1090class _ICLASS TDispatch : public TDispatchCOM {
1091 public:
1092 TDispatch(const TObjectDescriptor& obj, IUnknown* outer = 0);
1093 void InvalidateObject() {Object = 0;}
1094 operator IDispatch*();
1095
1096 void* Object; ///< pointer to C++ object instance, 0 if deleted
1097 TAutoClass* Class; ///< class of which object is an instance
1098 private:
1099 // IDispatch implementation
1100 HRESULT _IFUNC GetTypeInfoCount(unsigned int* pctinfo);
1101 HRESULT _IFUNC GetTypeInfo(unsigned int itinfo, LCID lcid,
1102 ITypeInfo** pptinfo);
1103 HRESULT _IFUNC GetIDsOfNames(const IID & riid, OLECHAR** rgszNames,
1104 unsigned int cNames, LCID lcid,
1105 DISPID* rgdispid);
1106 HRESULT _IFUNC Invoke(DISPID dispidMember, const IID & riid, LCID lcid,
1107 unsigned short wFlags,
1108 DISPPARAMS* pdispparams,
1109 VARIANT* pvarResult,
1110 EXCEPINFO* pexcepinfo,
1111 unsigned int* puArgErr);
1112};
1113
1114//----------------------------------------------------------------------------
1115/// \class TAutoObject
1116/// holders for C++ object pointers for automation conversions
1117//
1118
1119template<class T>
1121 public:
1122 void operator=(IDispatch& dp);
1123 void operator=(T* p) {P=p;}
1124 void operator=(T& r) {P=&r;}
1125 T& operator*() {return *P;}
1126 operator TObjectDescriptor() {return TObjectDescriptor(P, T::ClassInfo);}
1127 TAutoObject() : P(0) {}
1128 TAutoObject(T* p) {P=p;}
1129 TAutoObject(T& r) {P=&r;}
1130 TAutoObject(IDispatch& dr);
1131 operator T*() {return P;}
1132 operator T&() {return *P;}
1133 protected:
1134 T* P;
1135 T F();// only purpose to remove const for typeid incase T is a const class
1136};
1137
1138template<class T>
1140{
1141 TServedObject* obj;
1142 if (ifc.QueryInterface(IID_TServedObject, (void**)&obj) != 0)
1144 P = (T*)DynamicCast(obj->Object, obj->Class->GetTypeInfo(), typeid(T));
1145 if (!P)
1147}
1148
1149template<class T> void
1151{
1152 TServedObject* obj;
1153 if (ifc.QueryInterface(IID_TServedObject, (void**)&obj) != 0)
1155 P = (T*)DynamicCast(obj->Object, obj->Class->GetTypeInfo(), typeid(T));
1156 if (!P)
1158}
1159
1160template<class T> // for returning objects only, no IDispatch constructor
1162 public:
1163 void operator=(T* p) {this->P=p;}
1164 void operator=(T& r) {this->P=&r;}
1169 {return TObjectDescriptor(this->P,T::ClassInfo, TObjectDescriptor::Delete);}
1170};
1171
1172template<class T> // for returning objects by value
1174 public:
1175 void operator=(T o) {this->P=new T(o);}
1178};
1179
1180//----------------------------------------------------------------------------
1181/// \class TAutoIterator
1182/// automation collection iterator
1183//
1184
1185
1186class _OCFCLASS TAutoIterator : public IEnumVARIANT {
1187 public:
1188 // IEnumVARIANT implementation
1189 HRESULT _IFUNC QueryInterface(const GUID & iid, void** pif);
1190 unsigned long _IFUNC AddRef();
1191 unsigned long _IFUNC Release();
1192 HRESULT _IFUNC Next(unsigned long count, VARIANT* retvals,
1193 unsigned long* retcount);
1194 HRESULT _IFUNC Skip(unsigned long count);
1195 HRESULT _IFUNC Reset();
1196 HRESULT _IFUNC Clone(IEnumVARIANT** retiter);
1197
1198 // specific implementation required by derived classes
1199 virtual void Init()=0; // reset to first item
1200 virtual bool Test()=0; // test if item exists
1201 virtual void Step()=0; // advance to next item
1202 virtual void Return(TAutoVal& v)=0;// convert item to variant
1203 virtual TAutoIterator* Copy()=0; // return copy of iterator
1204
1205 // inline data member accessor functions
1206 TAutoSymbol* GetSymbol();
1207 void SetSymbol(TAutoSymbol* sym);
1208 operator IUnknown*(); // essentially a quick QueryInterface
1209
1210 virtual ~TAutoIterator();
1212 protected:
1213 TAutoSymbol* Symbol; // symbol entry generating this command
1214 TAutoCreator& Creator; // object to create returned automation objects
1215 IUnknown* Owner; // Release() must be called on destruction
1216 unsigned RefCnt;
1218 TAutoIterator(TAutoCreator& creator, IUnknown* owner, owl::TLangId lang); // called from derived
1219 TAutoIterator(TAutoIterator& copy); // copy constructor for base class
1220 };
1221
1222//____________________________________________________________________________
1223//
1224/// \class TAutoProxy
1225/// client C access proxy, base class
1226//____________________________________________________________________________
1227
1229 acMethod = 0x0001, ///< method call, same as OLE2
1230 acPropGet = 0x0002, ///< returns property value, same as OLE2
1231 acPropSet = 0x0004, ///< set property value, same as OLE2
1232 acVoidRet = 0x8000, ///< pass NULL for return variant, not OLE2 flag
1233};
1234
1235// TAutoProxyArgs is the base class of TAutoArgs.
1236//
1238 protected:
1239 TAutoProxyArgs(int cnt) : Count(cnt) {}
1240
1241 // Provides the address of the Args member which will be added in
1242 // the derived TAutoArgs template classes.
1243 //
1244 virtual TAutoVal* GetArgs() = 0;
1245
1246 public:
1247 operator TAutoVal&() {return *GetArgs();}
1248 operator VARIANT* () {return (VARIANT* )GetArgs();}
1249 operator unsigned int() {return Count;}
1250 TAutoVal& operator[](int index);
1251
1252 private:
1253 int Count;
1254};
1255
1256/// \class TAutoArgs
1257// ~~~~~~~~~~~~~~~
1258/// The first TAutoVal item of TAutoArgs holds the return value. Items at
1259/// indices 1 through N+1 represent the first, second, third ... paramters.
1260/// Of course, these parameters are optional.
1261//
1262template <int N>
1263struct TAutoArgs : public TAutoProxyArgs {
1266
1267 protected:
1268
1269 // Provides the address of Args.
1270 // Implemented as a (pure) virtual function to allow access to the Args
1271 // member also for TAutoArgs objects which are passed as TAutoProxyArgs.
1272 //
1273 virtual TAutoVal* GetArgs() {return Args;}
1274};
1275
1276
1277// class TAutoProxy
1278// ~~~~~ ~~~~~~~~~~
1279//
1281 public:
1282 ~TAutoProxy();
1283
1284 // Attach to [Detatch from] a dispatch interface
1285 //
1286 void Bind(IUnknown* obj);
1287 void Bind(IUnknown& obj);
1288 void Bind(const GUID& guid);
1289 void Bind(LPCTSTR progid);
1290 void Bind(TAutoVal& val);
1291 void Bind(IDispatch* obj);
1292 void Bind(IDispatch& obj);
1293 void Unbind(bool release = true);
1294
1295 // Check/Querry binding
1296 //
1297 void MustBeBound();
1298 bool IsBound() {return owl::ToBool(That != 0);}
1299
1300 // Check it there's a running copy of an object which supports IDispatch
1301 //
1302 static IDispatch* GetObject(LPCTSTR progid);
1303
1304 // Locale support
1305 //
1306 void SetLang(owl::TLangId lang) {Lang = lang;}
1307
1308 // Access to dispatch interface
1309 //
1310 operator IDispatch*();
1311 operator IDispatch&();
1312
1313 // Retrieve dispId
1314 //
1315 long Lookup(const long id) {return id;}
1316 long Lookup(LPCTSTR name);
1317 void Lookup(LPCTSTR names, long* ids, unsigned count);
1318
1319 protected:
1320 TAutoProxy(owl::TLangId lang) : That(0), Lang(lang) {}
1321
1322 // Invoke (IDispatch::Invoke)
1323 //
1324 TAutoVal& Invoke(owl::uint16 attr, TAutoProxyArgs& args, long* ids, unsigned named=0);
1325
1326 IDispatch* That;
1328};
1329
1331 TAutoDispId(TAutoProxy* prx, LPCTSTR name) : Id(prx->Lookup(name)) {}
1332 TAutoDispId(TAutoProxy*, long id) : Id(id) {}
1333 operator long*() {return &Id;}
1334 operator unsigned() {return 0;}
1335
1336 long Id;
1337};
1338
1339template <int N> struct TAutoDispIds {
1340 TAutoDispIds(TAutoProxy* prx, LPCTSTR names) {prx->Lookup(names, Ids);}
1341 long Ids[N+1];
1342 operator long*() {return Ids;}
1343 operator unsigned() {return N;}
1344};
1345
1347 public:
1348 void Bind(TAutoVal& val);
1349 void Unbind() { if (Iterator) Iterator->Release(); Iterator=0; Clear();}
1350 bool Step();
1351 void Clear() { Current.Clear(); }
1352 bool IsValid() { return Current.GetDataType() != atVoid; }
1353 void Object(TAutoProxy& prx) { prx.Bind(Current); }
1354 void operator =(const TAutoEnumeratorBase& copy);
1355 ~TAutoEnumeratorBase() { Unbind(); }
1356 protected:
1357 TAutoEnumeratorBase() : Iterator(0) {Current = TAutoVoid();}
1359 IEnumVARIANT* Iterator;
1361};
1362
1363template <class T>
1365 public:
1368 void Value(T& v);
1369 operator T();
1370};
1371
1372//____________________________________________________________________________
1373//
1374// Inline implementations for automation controller
1375//____________________________________________________________________________
1376
1377//
1378//
1380{
1381 // NOTE: It's OK to use Count as subscript since there's always one
1382 // addition TAutoVal/VARIANT for the return value.
1383 //
1384 PRECONDITION(index <= Count);
1385
1386 // NOTE: The logic below takes care of the difference in the C and
1387 // Automation calling conventions.
1388 //
1389 return *(GetArgs()+(index ? Count+1-index : 0));
1390}
1391
1392//
1393//
1394inline TAutoProxy::operator IDispatch&()
1395{
1396 // Following conditional avoid function call overhead - specially since
1397 // method is inline
1398 //
1399 if (!That)
1400 MustBeBound();
1401 return *That;
1402}
1403
1404//
1405//
1406inline TAutoProxy::operator IDispatch*()
1407{
1408 if (That)
1409 That->AddRef();
1410 return That;
1411}
1412
1413//
1414//
1415inline void TAutoProxy::Unbind(bool release)
1416{
1417 if (release && That)
1418 That->Release();
1419 That = 0;
1420}
1421
1422//
1423//
1425{
1426 Unbind();
1427}
1428
1429template<>
1430inline void TAutoEnumerator<short>::Value(short& v) { v = Current; }
1431
1432template<>
1433inline void TAutoEnumerator<long>::Value(long& v) { v = Current; }
1434
1435template<>
1436inline void TAutoEnumerator<bool>::Value(bool& v) { v = Current; }
1437
1438template<>
1440 { v = Current; }
1441template<>
1442inline TAutoEnumerator<short>::operator short() { return (short)Current; }
1443
1444template<>
1445inline TAutoEnumerator<long>::operator long() { return (long)Current; }
1446
1447template<>
1448inline TAutoEnumerator<bool>::operator bool() { return (bool)Current; }
1449
1450template<>
1453//____________________________________________________________________________
1454//
1455// Inline implementations for automation server - part 1
1456//____________________________________________________________________________
1457
1458// TAutoClass inlines
1459
1461 return Table;
1462}
1464 return ClassSymbol;
1465}
1469inline const std::type_info& TAutoClass::GetTypeInfo() const {
1470 return TypeInfo;
1471}
1472inline LPCTSTR TAutoClass::GetName(owl::TLangId id) const {
1473 return ClassSymbol->Name.Translate(id);
1474}
1475inline LPCTSTR TAutoClass::GetDoc (owl::TLangId id) const {
1476 return ClassSymbol->Doc.Translate(id);
1477}
1478inline unsigned long TAutoClass::GetHelpId() const {
1479 return ClassSymbol->HelpId;
1480}
1481inline unsigned short TAutoClass::GetTypeFlags() const {
1483}
1485 return ClassSymbol->TypeFlags>>12;
1486}
1487inline unsigned short TAutoClass::GetCoClassFlags() const {
1489}
1491 return Aggregator;
1492}
1493inline IUnknown& TAutoClass::Aggregate(ObjectPtr obj, TUnknown& inner) {
1494 return obj && Aggregator ? Aggregator(obj, inner) : (IUnknown&)inner;
1495}
1496
1497//____________________________________________________________________________
1498
1499// TAutoSymbol inlines
1500
1502 Attr |= mask;
1503}
1505 Attr &= owl::uint16(~mask);
1506}
1507inline bool TAutoSymbol::TestFlag(owl::uint16 mask) const {
1508 return (Attr&mask)? true : false;
1509}
1511 return (owl::uint16)Attr;
1512}
1513inline bool TAutoSymbol::IsEnum() const {
1514 return (Type->GetType() & atEnum)? true : false;
1515}
1516inline bool TAutoSymbol::IsByRef() const {
1517 return (Type->GetType() & atByRef)? true:false;
1518}
1519inline bool TAutoSymbol::IsArray() const {
1520 return (Type->GetType() & atSafeArray)? true : false;
1521}
1522inline bool TAutoSymbol::IsIterator() const {
1523 return ((Attr&asIterator)==asIterator) ? true : false;
1524}
1525inline bool TAutoSymbol::IsTerminator() const {
1526 return ((Attr & asNotTerminator)== 0) ? true : false;
1527}
1529 return owl::uint16(Type->GetType() & atTypeMask);
1530}
1532 return (Type->GetType() & atAutoClass)? (TAutoClass*)Type : 0;
1533}
1535 return (Type->GetType() & atEnum) ? (TAutoEnum*)Type : 0;
1536}
1543//____________________________________________________________________________
1544// TAutoString
1546:
1547 owl::TString(val.operator owl::TString())
1548//#if defined(BI_COMP_MSC)
1549// TString((TString)val.operator TString())
1550//#else
1551// TString((TString)val)
1552//#endif
1553{
1554}
1556 --*S; S = val; return *this;
1557}
1558
1559//____________________________________________________________________________
1560// TAutoVal inlines
1561
1562//
1563//
1565{
1566 Init();
1567}
1568
1569//
1570//
1572{
1573 Clear();
1574}
1575
1576//
1577//
1579{
1580 Init();
1581 ::VariantCopy((VARIANT*)this, (VARIANT*)&src);
1582}
1583
1584//
1585//
1586inline const TAutoVal& TAutoVal::operator=(const TAutoVal& src)
1587{
1588 // NOTE: 'VariantCopy' takes care of 'freeing' the destination
1589 //
1590 ::VariantCopy((VARIANT*)this, (VARIANT*)&src);
1591 return *this;
1592}
1593
1594inline TAutoVal::operator unsigned long(){return (unsigned long)operator long();}
1595//#if (MAXINT==MAXSHORT)
1596//inline TAutoVal::operator int() {return operator short();}
1597//inline TAutoVal::operator unsigned int() {return operator unsigned short();}
1598//inline TAutoVal::operator int*() {return (int*)operator short*();}
1599//#else
1600inline TAutoVal::operator int() {return operator long(); }
1601inline TAutoVal::operator unsigned int() {return (unsigned long)(long)*this;}
1602inline TAutoVal::operator int*() {return (int*)operator long*();}
1603//#endif
1604
1605inline TAutoVal::operator signed char() {return operator unsigned char();}
1606inline TAutoVal::operator char() {return operator unsigned char();}
1607inline TAutoVal::operator char*() {return (char*)operator unsigned char*();}
1608inline TAutoVal::operator signed char*() {return (signed char*)operator unsigned char*();}
1609
1610inline void TAutoVal::operator =(IUnknown* ifc){vt=atUnknown; punkVal=ifc;}
1611inline void TAutoVal::operator =(IDispatch* ifc){vt=atObject; pdispVal=ifc;}
1612
1613inline void TAutoVal::operator =(IPictureDisp* ifc){vt=atObject; pdispVal=ifc;}
1614inline void TAutoVal::operator =(IFontDisp* ifc){vt=atObject; pdispVal=ifc;}
1615
1616inline void TAutoVal::operator =(VARIANT& v){vt=atVariant; pvarVal= &v;}
1617inline void TAutoVal::operator =(unsigned char v){vt=atByte; bVal = v;}
1618inline void TAutoVal::operator =(signed char v){vt=atByte; bVal = v;}
1619inline void TAutoVal::operator =(char v){vt=atByte; bVal = v;}
1620inline void TAutoVal::operator =(short v){vt=atShort; iVal = v;}
1621inline void TAutoVal::operator =(long v){vt=atLong; lVal = v;}
1622inline void TAutoVal::operator =(float v){vt=atFloat; fltVal= v;}
1623inline void TAutoVal::operator =(double v){vt=atDouble; dblVal= v;}
1624inline void TAutoVal::operator =(owl::TBool v){vt=atBool; boolVal = short(v ? -1 : 0);}
1628inline void TAutoVal::operator =(const TNoArg& ){vt=atError; scode=DISP_E_PARAMNOTFOUND;}
1629
1630inline void TAutoVal::operator =(unsigned char* p){vt=atByte+atByRef; pbVal=p;}
1631inline void TAutoVal::operator =(signed char* p){vt=atByte+atByRef; pbVal=(unsigned char*) p;}
1632inline void TAutoVal::operator =(char* p){vt=atByte+atByRef; pbVal=(unsigned char*) p;}
1633inline void TAutoVal::operator =(short* p){vt=atShort+atByRef; piVal=p;}
1634inline void TAutoVal::operator =(long* p){vt=atLong+atByRef; plVal=p;}
1635inline void TAutoVal::operator =(owl::TBool* p){vt=atBool+atByRef; pbool=(VARIANT_BOOL*)p;}
1636inline void TAutoVal::operator =(float* p){vt=atFloat+atByRef; pfltVal=p;}
1637inline void TAutoVal::operator =(double* p){vt=atDouble+atByRef;pdblVal=p;}
1638inline void TAutoVal::operator =(void* p){vt=atVoid+atByRef;byref=p;}
1641
1642inline void TAutoVal::operator =(unsigned short v){vt=atLong; lVal = (long)v;}
1643inline void TAutoVal::operator =(unsigned short* p){vt=atShort+atByRef; piVal = (short*)p;}
1644inline void TAutoVal::operator =(unsigned long v){vt=atLong; lVal = (long)v;}
1645inline void TAutoVal::operator =(unsigned long* p){vt=atLong+atByRef; plVal = (long*)p;}
1646//#if (MAXINT==MAXSHORT)
1647//inline void TAutoVal::operator =(int v){vt=atShort; iVal=v;}
1648//inline void TAutoVal::operator =(int* p){vt=atShort+atByRef; piVal=(short*)p;}
1649//inline void TAutoVal::operator =(unsigned int v){operator =((unsigned short)v);}
1650//inline void TAutoVal::operator =(unsigned int* p){operator =((unsigned short*)p);}
1651//#else
1652inline void TAutoVal::operator =(int v){vt=atLong; lVal=v;}
1653inline void TAutoVal::operator =(int* p){vt=atLong+atByRef; plVal = (long*)p;}
1654inline void TAutoVal::operator =(unsigned int v){operator =((unsigned long)v);}
1655inline void TAutoVal::operator =(unsigned int* p){operator =((unsigned long*)p);}
1656//#endif
1657
1658// The following operators are added to complement the functionality of TAutoVal
1661inline void TAutoVal::operator =(IUnknown** p){vt=atUnknown+atByRef; ppunkVal=p;}
1662inline void TAutoVal::operator =(IDispatch** p){vt=atObject+atByRef; ppdispVal=p;}
1664inline void TAutoVal::operator =(LARGE_INTEGER v){vt=VT_I8; hVal=v;}
1665inline void TAutoVal::operator =(ULARGE_INTEGER v){vt=VT_UI8; uhVal=v;}
1666inline void TAutoVal::operator =(SAFEARRAY* p) { SafeArrayGetVartype(p, &vt); vt |= VT_ARRAY; parray = p; }
1667#if defined(_WIN64)
1668inline void TAutoVal::operator =(ULONG_PTR v){vt=VT_UI8; uptrVal=v;}
1669#endif
1670//
1671//
1672
1674{
1675 vt = atObjectDesc;
1676 ObjDesc.Object= od.Object;
1677 ObjDesc.Class = od.Class;
1679 vt |= atByRef;
1680}
1681
1682//
1683//
1684inline int TAutoVal::GetDataType() const {
1685 return vt;
1686}
1687
1688//
1689//
1690inline void TAutoVal::Init()
1691{
1692 memset(this, 0, sizeof(*this));
1693}
1694
1695//
1696//
1697inline void TAutoVal::Clear()
1698{
1699 if ((vt & ~atByRef) == atLoanedBSTR) {
1700 s.Holder->ReleaseBstr((vt & atByRef) ? *pbstrVal : bstrVal);
1701 vt = owl::uint16(atString | (vt & atByRef));
1702 }
1703 ::VariantClear((VARIANT*)this);
1704}
1705
1706//
1707//
1709{
1710 if ((vt & ~atByRef) == atLoanedBSTR) {
1711 s.Holder->RevokeBstr((vt & atByRef) ? *pbstrVal : bstrVal);
1712 vt = owl::uint16(atString | (vt & atByRef));
1713 } else if (vt == owl::uint16(atBool | atByRef) && *pbool != 0) {
1714 *pbool = -1;
1715 }
1716
1717 // Need to check if atObjectDesc? Should never happen as it is temporary
1718}
1719
1720//
1721//
1722inline void TAutoVal::Copy(const TAutoVal& copy)
1723{
1724 vt = copy.vt;
1725 p = copy.p;
1726 if (vt == atUnknown || vt == atObject)
1727 punkVal->AddRef();
1728 if (vt == atString)
1730}
1731
1732/// Converts TAutoVal/VARIANT to another type
1733/// \note Converts in-place if source is not specified
1734//
1735inline HRESULT TAutoVal::ChangeType(VARTYPE varType, TAutoVal* src) {
1736 return ::VariantChangeType((VARIANT*)this, src ? (VARIANT*)src : (VARIANT*)this, 0, varType);
1737}
1738
1739/// Is TAutoVal Object (i.e. VARIANT) passing data by reference
1740//
1741inline bool TAutoVal::IsRef() const {
1742 return (vt & atByRef) ? true : false;
1743}
1744
1745//
1746//
1748 return vt==atVariant+atByRef ? (TAutoVal*)pvarVal : this;
1749}
1750
1751//
1752//
1754 return vt==atString ? bstrVal : 0;
1755}
1756
1757//
1758//
1760{
1761 if ((char)vt != atObjectDesc)
1762 return false;
1763 od.Object = ObjDesc.Object;
1764 od.Class = ObjDesc.Class;
1766 return true;
1767}
1768
1769//
1770//
1771inline SAFEARRAY* TAutoVal::GetArray()
1772{
1773 if ((vt & atSafeArray) == 0)
1774 {
1775 return 0;
1776 }
1777
1778 return (vt & atByRef ? *pparray : parray);
1779
1780/*
1781 if (vt == atSafeArray)
1782 return parray;
1783 if (vt == (atSafeArray|atByRef))
1784 return *pparray;
1785 return 0;
1786*/
1787}
1788
1789//
1790//
1791inline void* TAutoVal::SetByRef(AutoDataType datatype)
1792{
1793 if (vt == atVariant)
1794 return this;
1795 vt = owl::uint16(datatype);
1796 return &byref;
1797}
1798
1799//____________________________________________________________________________
1800// TServedObject inlines
1801
1802inline TServedObject::operator IDispatch*()
1803{
1804 AddRef();
1805 return (IDispatch*)this; // essentially a quick QueryInterface on the obj
1806}
1807
1808// TDispatch inlines
1809
1810inline TDispatch::operator IDispatch*()
1811{
1812 AddRef();
1813 return (IDispatch*)this; // essentially a quick QueryInterface on the obj
1814}
1815
1816//____________________________________________________________________________
1817
1818// TAutoCommand inlines
1819
1820inline TAutoCommand::TAutoCommand(int attr) : Attr(attr), Symbol(0) {}
1821inline void TAutoCommand::SetFlag(int mask) {Attr |= mask;}
1822inline void TAutoCommand::ClearFlag(int mask) {Attr&=(~mask);}
1823inline bool TAutoCommand::TestFlag(int mask) {return owl::ToBool((Attr&mask)==mask);}
1827inline LPCTSTR TAutoCommand::LookupError(long errCode)
1828 {return TAutoCommand_ErrorLookup ? TAutoCommand_ErrorLookup(errCode) : 0;}
1829//____________________________________________________________________________
1830
1831// TAutoEnum inlines and template function definitions
1832
1833inline TAutoEnum::TAutoEnum(int count, int type)
1834 : Count(count) { Type = short(type + atEnum); }
1835
1836template <class T> inline
1837TAutoEnumT<T>::TAutoEnumT(TAutoEnumVal<T>* table, int symcount, int type)
1838: TAutoEnum(symcount, type), Table(table) {}
1839
1840// incoming enumeration string localized lookup
1841//
1842template <class T> bool
1844{
1845 const owl::TString& stringRef = txtVal.StrVal(); // 0 if not string type
1846 const _TCHAR* str = stringRef;
1847 if (str) {
1848 owl::TLangId langId = txtVal.GetLanguage();
1849 for (int i = 0; i < Count; i++) {
1850 if (Table[i].Name.Compare(str, langId) == 0) {
1851 numVal = Table[i].Val;
1852 return true;
1853 }
1854 }
1855 }
1856 return false;
1857}
1858
1859// outgoing enumeration translation to localized string
1860//
1861template <class T> bool
1863{
1864 T val;
1865 val = numVal; // perhaps we should put a try/catch here!!
1866 for (int i = 0; i < Count; i++) {
1867 if (Table[i].Val == val) {
1868 numVal = Table[i].Name.Translate(langId);
1869 numVal.SetLocale(langId);
1870 return true;
1871 }
1872 }
1873 return false;
1874}
1875
1876// special case for outgoing string enumerations
1877//
1878/// BGM: PRON 1325 (compiler bug) prevents this \#pragma for working
1879/// with some templatized functions. Deferred for Ebony.
1880#pragma warn -inl
1881template<>
1882inline bool
1884{
1885 LPCTSTR str = numVal.StrVal(); // 0 if not string type
1886 if (str)
1887 for (int i = 0; i < Count; i++) {
1888 if (lstrcmp(Table[i].Val, str) == 0) {
1889 numVal = Table[i].Name.Translate(langId);
1890 numVal.SetLocale(langId);
1891 return true;
1892 }
1893 }
1894 return false;
1895}
1896#pragma warn .inl
1897
1898//____________________________________________________________________________
1899
1900// TAutoIterator inlines
1901
1902inline TAutoIterator::operator IUnknown*() {RefCnt++; return this;}
1905
1906//____________________________________________________________________________
1907//
1908// Inline implementations for automation server - part 2
1909// These are inline only for the purpose of allowing _AUTOCLASS
1910// to be specified at compile time without rebuilding OCF library
1911// This applies to classes: TAutoBase, TAutoCommand, TAutoDetach
1912//____________________________________________________________________________
1913
1915{
1916 ::ocf::SendObituary(this, typeid(TAutoBase));
1917}
1918
1919inline void TAutoDetach::Notify(int offset, const std::type_info& typeInfo)
1920{
1921 ::ocf::SendObituary((char*)this-offset, typeInfo);
1922}
1923//____________________________________________________________________________
1924
1925// TAutoCommand implementation specified inline to avoid _AUTOCLASS link errors
1926
1927inline void TAutoCommand::Fail(TXAuto::TError err) { throw TXAuto(err); }
1928
1929inline bool TAutoCommand::Validate() { return true; }
1930
1932{
1933 if (!TAutoCommand_InvokeHook || TAutoCommand_InvokeHook(*this))
1934 Execute();
1935 return *this;
1936}
1937
1939{
1940}
1941
1943{
1944 return 0;
1945}
1946
1948{
1949 v = TAutoVoid();
1950}
1951
1953{
1954}
1955
1957
1958inline int TAutoCommand::Record(TAutoStack&) {return 0;}
1959
1962 TErrorMsgHook hook = TAutoCommand_ErrorLookup;
1963 TAutoCommand_ErrorLookup = callback;
1964 return hook;
1965}
1966
1969 TCommandHook hook = TAutoCommand_InvokeHook;
1970 TAutoCommand_InvokeHook = callback;
1971 return hook;
1972}
1973
1974# if defined(BI_COMP_BORLANDC)
1975# pragma warn .inl
1976# endif
1977
1978
1979} // OCF namespace
1980
1981
1982#endif // OCF_AUTODEFS_H
1983
1984
#define _AUTOCLASS
Definition autodefs.h:39
#define PRECONDITION(condition)
Definition checks.h:227
virtual ~TAutoBase()
Definition autodefs.h:1914
short CommandCount
command count including bases, 0 if uncounted
Definition autodefs.h:179
bool AutoIds
generate ID's automatically if true (default)
Definition autodefs.h:182
TAutoSymbol * ClassSymbol
pointer to class symbol (terminator)
Definition autodefs.h:184
unsigned short GetCoClassFlags() const
Definition autodefs.h:1487
int GetImplTypeFlags() const
Definition autodefs.h:1484
TAutoSymbol * GetTable() const
Definition autodefs.h:1460
TAggregator Aggregator
aggregator function for C++ COM classes
Definition autodefs.h:178
LPCTSTR GetDoc(owl::TLangId lang=owl::TLocaleString::UserDefaultLangId) const
Definition autodefs.h:1475
TAutoSymbol * GetClassSymbol() const
Definition autodefs.h:1463
unsigned long GetHelpId() const
Definition autodefs.h:1478
IUnknown & Aggregate(ObjectPtr obj, TUnknown &inner)
Definition autodefs.h:1493
TAutoSymbol * Table
pointer to array of symbol entries
Definition autodefs.h:183
short VariableCount
number of symbols exposed as typelib variables
Definition autodefs.h:181
TAggregator GetAggregator() const
Definition autodefs.h:1490
TAutoCommandBuildDtr GetDestructor() const
Definition autodefs.h:1466
short FunctionCount
number of symbols exposed as typelib functions
Definition autodefs.h:180
const std::type_info & TypeInfo
for validating type of data pointers
Definition autodefs.h:185
unsigned short GetTypeFlags() const
Definition autodefs.h:1481
const std::type_info & GetTypeInfo() const
Definition autodefs.h:1469
LPCTSTR GetName(owl::TLangId lang=owl::TLocaleString::UserDefaultLangId) const
Definition autodefs.h:1472
Automation abstract base class for command objects.
Definition autodefs.h:846
TAutoCommand(int attr)
Definition autodefs.h:1820
TAutoSymbol * Symbol
Definition autodefs.h:880
virtual TAutoCommand * Undo()
Definition autodefs.h:1956
void Fail(TXAuto::TError)
Definition autodefs.h:1927
virtual TAutoCommand & Invoke()
Definition autodefs.h:1931
static LPCTSTR LookupError(long errCode)
Definition autodefs.h:1827
virtual int Record(TAutoStack &q)
Definition autodefs.h:1958
bool TestFlag(int mask)
Definition autodefs.h:1823
virtual bool Validate()
Definition autodefs.h:1929
LPCTSTR(* TErrorMsgHook)(long errCode)
Definition autodefs.h:863
static TCommandHook SetCommandHook(TCommandHook callback)
Definition autodefs.h:1968
virtual void Return(TAutoVal &v)
Definition autodefs.h:1947
virtual void Transfer(TAutoTransfer &x)
Definition autodefs.h:1952
void SetSymbol(TAutoSymbol *sym)
Definition autodefs.h:1826
TAutoSymbol * GetSymbol()
Definition autodefs.h:1825
bool(* TCommandHook)(TAutoCommand &cmdObj)
Definition autodefs.h:866
static TErrorMsgHook SetErrorMsgHook(TErrorMsgHook callback)
Definition autodefs.h:1961
virtual ~TAutoCommand()
Definition autodefs.h:850
void SetFlag(int mask)
Definition autodefs.h:1821
virtual void Execute()
Definition autodefs.h:1938
virtual long Report()
Definition autodefs.h:1942
void ClearFlag(int mask)
Definition autodefs.h:1822
Object responsible for creating automation COM object.
Definition autodefs.h:924
virtual TUnknown * CreateObject(TObjectDescriptor objDesc, IUnknown *outer=0)=0
virtual void Attach(TServedObject &obj)
Definition autodefs.h:931
virtual IDispatch * CreateDispatch(TObjectDescriptor objDesc, IUnknown *outer=0)=0
virtual void Detach(TServedObject &obj)
Definition autodefs.h:932
void Notify(int offset, const std::type_info &typeInfo)
Definition autodefs.h:1919
int Count
length of this symbol table
Definition autodefs.h:907
virtual bool Convert(TAutoVal &txtVal, TAutoVal &numVal)=0
virtual bool Convert(TAutoVal &numVal, owl::TLangId langId)=0
TAutoEnum(int count, int type)
Definition autodefs.h:1833
bool Convert(TAutoVal &txtVal, TAutoVal &numVal)
Definition autodefs.h:1843
TAutoEnumVal< T > * Table
pointer to array of symbol entries
Definition autodefs.h:917
TAutoEnumT(TAutoEnumVal< T > *table, int symcount, int type)
Definition autodefs.h:1837
void Object(TAutoProxy &prx)
Definition autodefs.h:1353
IEnumVARIANT * Iterator
Definition autodefs.h:1359
TAutoEnumerator(const TAutoEnumerator< T > &cpy)
Definition autodefs.h:1367
automation collection iterator
Definition autodefs.h:1186
virtual void Return(TAutoVal &v)=0
TAutoSymbol * GetSymbol()
Definition autodefs.h:1903
TAutoSymbol * Symbol
Definition autodefs.h:1213
virtual void Step()=0
owl::TLangId Lang
Definition autodefs.h:1217
TAutoClass * Class
Definition autodefs.h:1211
virtual TAutoIterator * Copy()=0
IUnknown * Owner
Definition autodefs.h:1215
void SetSymbol(TAutoSymbol *sym)
Definition autodefs.h:1904
virtual bool Test()=0
TAutoCreator & Creator
Definition autodefs.h:1214
virtual void Init()=0
holders for C++ object pointers for automation conversions
Definition autodefs.h:1120
void operator=(T &r)
Definition autodefs.h:1124
void operator=(IDispatch &dp)
Definition autodefs.h:1150
void operator=(T *p)
Definition autodefs.h:1123
TAutoProxyArgs(int cnt)
Definition autodefs.h:1239
virtual TAutoVal * GetArgs()=0
TAutoVal & operator[](int index)
Definition autodefs.h:1379
client C access proxy, base class
Definition autodefs.h:1280
TAutoProxy(owl::TLangId lang)
Definition autodefs.h:1320
void Bind(IUnknown *obj)
Definition autocli.cpp:46
void Unbind(bool release=true)
Definition autodefs.h:1415
long Lookup(const long id)
Definition autodefs.h:1315
owl::TLangId Lang
Definition autodefs.h:1327
IDispatch * That
Definition autodefs.h:1326
void SetLang(owl::TLangId lang)
Definition autodefs.h:1306
Automation argument stack abstraction.
Definition autodefs.h:813
owl::TLangId LangId
Definition autodefs.h:827
TServedObject * Owner
Definition autodefs.h:828
TAutoVal Default
Definition autodefs.h:835
TAutoSymbol * Symbol
Symbol of method/prop, args follow.
Definition autodefs.h:822
long ErrorCode
Set if TXAuto::xErrorStatus returned.
Definition autodefs.h:829
int CurrentArg
Index of last arg requested by operator[].
Definition autodefs.h:823
LPCTSTR ErrorMsg
Set if TXAuto::xErrorStatus returned.
Definition autodefs.h:830
TAutoVal * Stack
Definition autodefs.h:836
long * NamedIds
Definition autodefs.h:834
Based on reference counted TString with added automation functionality.
Definition autodefs.h:492
TAutoString(const wchar_t *s)
Definition autodefs.h:495
TAutoString(const owl::tstring &s)
Definition autodefs.h:497
TAutoString(const TAutoString &src)
Definition autodefs.h:500
TAutoString(const char *s=0)
Definition autodefs.h:494
TAutoString(owl::TUString *s)
Definition autodefs.h:498
TAutoString(BSTR s, bool loan)
Definition autodefs.h:496
static TAutoType ClassInfo
Definition autodefs.h:509
TAutoString & operator=(const char *s)
Definition autodefs.h:502
Automation data element (same data as OLE/BASIC VARIANT)
Definition autodefs.h:526
VARIANT_BOOL boolVal
Definition autodefs.h:745
owl::TUString * Holder
String holder sharing current BSTR.
Definition autodefs.h:780
struct ocf::TAutoVal::@47::@50 s
TAutoVal(unsigned char *p)
Definition autodefs.h:541
TAutoVal(IPictureDisp *ifc)
Definition autodefs.h:577
SAFEARRAY * parray
Definition autodefs.h:752
double dblVal
Definition autodefs.h:744
TAutoVal(long *p)
Definition autodefs.h:552
TAutoVal(float i)
Definition autodefs.h:557
TAutoVal(signed char *p)
Definition autodefs.h:542
owl::TString StrVal()
Definition autodefs.h:1753
SAFEARRAY * GetArray()
Definition autodefs.h:1771
TAutoVal(TAutoCurrency *p)
Definition autodefs.h:570
bool GetObjDesc(TObjectDescriptor &)
Definition autodefs.h:1759
LARGE_INTEGER hVal
Also support LARGE_INTEGER.
Definition autodefs.h:785
TAutoVal(LARGE_INTEGER v)
Definition autodefs.h:587
TAutoVal(owl::TString s)
Definition autodefs.h:568
TAutoVal(char *p)
Definition autodefs.h:543
int GetDataType() const
Definition autodefs.h:1684
struct ocf::TAutoVal::@47::@49 p
bool IsRef() const
Is TAutoVal Object (i.e. VARIANT) passing data by reference.
Definition autodefs.h:1741
TAutoVal * DereferenceVariant()
Definition autodefs.h:1747
TAutoVal(TBSTR *p)
Definition autodefs.h:585
TAutoVal(SAFEARRAY *v)
Definition autodefs.h:589
VARIANT_BOOL * pbool
Definition autodefs.h:758
TAutoCurrency cyVal
Definition autodefs.h:747
BSTR Val
< Added info when loaned BSTR ownership
Definition autodefs.h:779
LCID Locale
Unused 4 bytes for pointer types.
Definition autodefs.h:775
TAutoVal(unsigned short *p)
Definition autodefs.h:550
void SetLocale(TLocaleId)
Definition autoval.cpp:77
TAutoVal(TAutoDate i)
Definition autodefs.h:571
TAutoVal(unsigned long *p)
Definition autodefs.h:554
void Copy(const TAutoVal &copy)
Definition autodefs.h:1722
IDispatch * pdispVal
Definition autodefs.h:751
TAutoVal(IUnknown **ifc)
Definition autodefs.h:576
SAFEARRAY ** pparray
Definition autodefs.h:765
TAutoVal(unsigned int i)
Definition autodefs.h:547
TAutoVal(unsigned long i)
Definition autodefs.h:553
TAutoVal(const owl::tstring &s)
Definition autodefs.h:564
unsigned char * pbVal
Definition autodefs.h:753
TAutoVal(const char *p)
Definition autodefs.h:544
IDispatch ** ppdispVal
Definition autodefs.h:764
TAutoVal(signed char i)
Definition autodefs.h:539
TAutoVal(int i)
Definition autodefs.h:545
TAutoVal(short i)
Definition autodefs.h:555
SCODE * pscode
Definition autodefs.h:759
TAutoVal(TAutoString s)
Definition autodefs.h:566
TAutoVal(short *p)
Definition autodefs.h:556
TAutoVal(VARIANT &v)
Definition autodefs.h:579
TAutoVal(IDispatch **ifc)
Definition autodefs.h:574
ULARGE_INTEGER uhVal
Also support ULARGE_INTEGER.
Definition autodefs.h:786
unsigned char bVal
Definition autodefs.h:740
TAutoVal(float *p)
Definition autodefs.h:558
TAutoVal(TAutoCurrency i)
Definition autodefs.h:569
void * SetByRef(AutoDataType)
Definition autodefs.h:1791
const TAutoVal & operator=(const TAutoVal &src)
Definition autodefs.h:1586
HRESULT ChangeType(VARTYPE type, TAutoVal *src=0)
Converts TAutoVal/VARIANT to another type.
Definition autodefs.h:1735
TAutoVal(TAutoDate *i)
Definition autodefs.h:572
TAutoVal(int *p)
Definition autodefs.h:546
TAutoVal(owl::TBool *p)
Definition autodefs.h:563
TAutoVal(double i)
Definition autodefs.h:559
TAutoVal(long i)
Definition autodefs.h:551
TAutoVal(IUnknown *ifc)
Definition autodefs.h:575
float * pfltVal
Definition autodefs.h:756
IUnknown * punkVal
Definition autodefs.h:750
double * pdblVal
Definition autodefs.h:757
TAutoVal(double *p)
Definition autodefs.h:560
TAutoVal(IDispatch *ifc)
Definition autodefs.h:573
BSTR * pbstrVal
Definition autodefs.h:762
TAutoVal(BSTR *p)
Definition autodefs.h:584
TAutoVal(ULARGE_INTEGER v)
Definition autodefs.h:588
VARIANT * pvarVal
Definition autodefs.h:766
short * piVal
Definition autodefs.h:754
TAutoVal(char i)
Definition autodefs.h:540
TAutoVal(const TNoArg &n)
Definition autodefs.h:580
DATE * pdate
Definition autodefs.h:761
TAutoCurrency * pcyVal
Definition autodefs.h:760
void Restore()
Definition autodefs.h:1708
void * Val
< Added locale info for BSTR/IDispatch
Definition autodefs.h:774
TAutoVal(owl::TBool i)
Definition autodefs.h:562
long * plVal
Definition autodefs.h:755
void * byref
Definition autodefs.h:767
IUnknown ** ppunkVal
Definition autodefs.h:763
TAutoVal(unsigned short i)
Definition autodefs.h:549
owl::TLangId GetLanguage() const
Definition autoval.cpp:106
TAutoVal(unsigned int *p)
Definition autodefs.h:548
TAutoVal(unsigned char i)
Definition autodefs.h:538
TAutoVal(IFontDisp *ifc)
Definition autodefs.h:578
TAutoVal(void *p)
Definition autodefs.h:561
TObjectDescBase ObjDesc
Temporary space for returning object.
Definition autodefs.h:783
TAutoVal(TAutoVal *p)
Definition autodefs.h:586
TAutoClass * Class
class of which object is an instance
Definition autodefs.h:1097
void * Object
pointer to C++ object instance, 0 if deleted
Definition autodefs.h:1096
void InvalidateObject()
Definition autodefs.h:1093
OC Control Event class for standard control events.
Definition occtrl.h:202
Class representing an embedded control within a document.
Definition occtrl.h:78
The TOcxView partner is a container (viewer) of a given (server/client) document.
Definition occtrl.h:273
TAppDescriptor & GetAppDesc()
Definition autodefs.h:943
TServedObject * GetAppObject()
Definition autodefs.h:944
TAppDescriptor & AppDesc
Definition autodefs.h:947
TServedObject * AppObject
Definition autodefs.h:948
OLE object exposed for automated access of internal object.
Definition autodefs.h:972
owl::ulong _IFUNC AddRef()
Definition autodefs.h:993
TServedObjectCreator & GetCreator()
Definition autodefs.h:978
owl::ulong _IFUNC Release()
Definition autodefs.h:994
TServedObjectCreator & Creator
Definition autodefs.h:985
TServedObject * GetAppObject()
Definition autodefs.h:977
TObjectDescriptor::TDestruct Destruct
what to do with C++ object
Definition autodefs.h:988
void * Object
pointer to C++ object instance, 0 if deleted
Definition autodefs.h:982
const void * RootObject
pointer to object of most derived class
Definition autodefs.h:983
HRESULT _IFUNC QueryInterface(const GUID &iid, void **iface)
Definition autodefs.h:995
owl::TLangId ReqLang
language requested by caller
Definition autodefs.h:986
TAutoClass * Class
class of which object is an instance
Definition autodefs.h:984
Standard implementation of a controlling IUnknown for an object, to be inherited with other COM inter...
Definition oleutil.h:264
Automation exception object.
Definition autodefs.h:115
TError ErrorCode
Definition autodefs.h:135
@ xParameterMissing
Definition autodefs.h:124
@ xConversionFailure
Definition autodefs.h:119
@ xExecutionFailure
Definition autodefs.h:127
@ xForeignIDispatch
Definition autodefs.h:121
@ xValidateFailure
Definition autodefs.h:126
@ xNoDefaultValue
Definition autodefs.h:125
Reference to reference counted string object TUString Lightweight reference object consisting of a po...
Definition string.h:67
TUString * S
Definition string.h:121
System string (BSTR) encapsulation.
Definition string.h:33
Privately used by TString to manage string pointers This is a reference counted union of various stri...
Definition string.h:145
Derived from xmsg, TXBase is the base class for ObjectWindows and ObjectComponents exception-handling...
Definition exbase.h:41
TLocaleString - localized name support.
Object Component Framework (COM encapsulation)
Definition appdesc.h:22
const owl::uint16 atEnum
Definition autodefs.h:346
const owl::uint16 tfAutomation
Definition autodefs.h:391
const owl::uint16 tfAutoClassMask
Definition autodefs.h:384
const owl::uint16 tfDual
Definition autodefs.h:390
const owl::uint16 tfControl
Definition autodefs.h:364
const owl::uint16 tfRestricted
Definition autodefs.h:375
IUnknown &(* TAggregator)(ObjectPtr obj, TUnknown &inner)
Definition autodefs.h:102
const owl::uint16 tfAppObject
Definition autodefs.h:360
TAutoCommand *(* TAutoCommandBuildDtr)(ObjectPtr obj, int attr)
Definition autodefs.h:98
const owl::uint16 tfImplFlagXfer
Definition autodefs.h:376
const owl::uint16 tfHidden
Definition autodefs.h:382
TAutoLong TAutoInt
Definition autodefs.h:290
AutoCallFlag
Definition autodefs.h:1228
@ acVoidRet
pass NULL for return variant, not OLE2 flag
Definition autodefs.h:1232
@ acPropGet
returns property value, same as OLE2
Definition autodefs.h:1230
@ acPropSet
set property value, same as OLE2
Definition autodefs.h:1231
@ acMethod
method call, same as OLE2
Definition autodefs.h:1229
class _ICLASS TServedObject
Definition appdesc.h:29
const owl::uint16 tfNormal
Definition autodefs.h:397
TAutoCommand *(* TAutoCommandBuild)(ObjectPtr obj, int attr, TAutoStack &)
Definition autodefs.h:97
void * ObjectPtr
Definition autodefs.h:84
ObjectPtr(* TAutoSymTypeConvert)(ObjectPtr obj)
Definition autodefs.h:96
const void * MostDerived(const void *obj, const std::type_info &src)
Definition autosym.cpp:416
const owl::uint16 atAutoClass
Definition autodefs.h:347
const owl::uint16 atSafeArray
Definition autodefs.h:344
AutoSymFlag
Attribute flags for automation symbols and command objects.
Definition autodefs.h:297
@ asClass
extension to another class symbol table
Definition autodefs.h:307
@ asIterator
iterator property (_NewEnum)
Definition autodefs.h:302
@ asHidden
not visible to normal browsing
Definition autodefs.h:315
@ asGetSet
can get or set property(...GET + ...SET)
Definition autodefs.h:304
@ asPersistent
property is persistent
Definition autodefs.h:316
@ asRequestEdit
sends OnRequest edit before change
Definition autodefs.h:312
@ asDisplayBind
user-display of bindable
Definition autodefs.h:313
@ asNotTerminator
any symbol except terminator with class info
Definition autodefs.h:309
@ asOleType
method or property exposed for OLE
Definition autodefs.h:299
@ asGet
returns property value (INVOKE_PROPERTYGET)
Definition autodefs.h:301
@ asBindable
sends OnChanged notification
Definition autodefs.h:311
@ asAnyCommand
any command: method, property get/set, build
Definition autodefs.h:298
@ asSet
set property value (INVOKE_PROPERTYSET)
Definition autodefs.h:303
@ asDefaultBind
this property only is the default (redundant)
Definition autodefs.h:314
@ asArgument
property returning an object
Definition autodefs.h:308
@ asMethod
method (same as OLE INVOKE_FUNC)
Definition autodefs.h:300
@ asBuild
contructor command (unsupported by OLE 2.01)
Definition autodefs.h:305
@ asFactory
for creating objects or class determination
Definition autodefs.h:306
const owl::uint16 tfPredeclared
Definition autodefs.h:363
const void * DynamicCast(const void *obj, const std::type_info &src, const std::type_info &dst)
Definition autosym.cpp:394
TAutoCommand * AutoQuitBuild(ObjectPtr obj, int attr, TAutoStack &args)
Definition autosym.cpp:356
const owl::uint16 tfLicensed
Definition autodefs.h:362
const owl::uint16 tfNonextensible
Definition autodefs.h:383
EXTERN_C const GUID IID_TServedObject
Definition autodefs.h:107
class _ICLASS TDispatch
Definition autodefs.h:956
const owl::uint16 atByRef
Definition autodefs.h:345
const GUID & iid
Definition appdesc.h:328
TAutoIterator *(* TAutoIteratorBuild)(ObjectPtr obj, TAutoCreator &creator, IUnknown *owner, owl::TLangId lang)
Definition autodefs.h:99
struct _OCFCLASS TAutoTransfer
Definition autodefs.h:839
TAutoLongRef TAutoIntRef
Definition autodefs.h:291
const owl::uint16 tfDefault
Definition autodefs.h:373
const owl::uint16 tfEventSource
Definition autodefs.h:374
unsigned long TLocaleId
Definition autodefs.h:72
AutoDataType
Automation datatypes and flags - same as OLE 2 definitions.
Definition autodefs.h:322
@ atLong
Definition autodefs.h:326
@ atObject
Definition autodefs.h:332
@ atString
Definition autodefs.h:331
@ atByte
Definition autodefs.h:337
@ atVoid
Definition autodefs.h:323
@ atError
Definition autodefs.h:333
@ atDatetime
Definition autodefs.h:330
@ atCurrency
Definition autodefs.h:329
@ atUnknown
Definition autodefs.h:336
@ atLoanedBSTR
Definition autodefs.h:340
@ atBool
Definition autodefs.h:334
@ atArray
Definition autodefs.h:338
@ atDouble
Definition autodefs.h:328
@ atTypeMask
Definition autodefs.h:341
@ atVariant
Definition autodefs.h:335
@ atFloat
Definition autodefs.h:327
@ atObjectDesc
Definition autodefs.h:339
@ atShort
Definition autodefs.h:325
@ atOLE2Mask
Definition autodefs.h:342
@ atNull
Definition autodefs.h:324
const owl::uint16 tfCoClassXfer
Definition autodefs.h:365
const owl::uint16 tfCanCreate
Definition autodefs.h:361
TAutoString
Definition occtrl.cpp:135
void SendObituary(const void *obj, const std::type_info &typeInfo)
Definition autosym.cpp:44
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
signed long int32
Definition number.h:30
unsigned long ulong
Definition number.h:26
bool TBool
Definition defs.h:288
unsigned long uint32
Definition number.h:34
owl::uint16 TLangId
Holds a language ID, a predefined number that represents a base language and dialect.
Definition lclstrng.h:26
bool ToBool(const T &t)
Definition defs.h:291
unsigned short uint16
Definition number.h:33
BSTR SysAllocString(const char *str)
Definition string.h:130
std::string tstring
Definition defs.h:79
unsigned int uint
Definition number.h:25
ObjectComponents fundamental definitions.
#define _OCFFUNC(p)
Definition defs.h:47
#define _OCFCLASS
Definition defs.h:45
#define _OCFDATA(p)
Definition defs.h:46
Low level OLE Utility class definitions.
#define _IFUNC
Definition oleutil.h:28
#define DECLARE_COMBASES2(cls, i1, i2)
Definition oleutil.h:386
#define _ICLASS
Definition oleutil.h:25
#define DECLARE_COMBASES1(cls, i1)
Definition oleutil.h:384
Definition of class TString, a flexible universal string envelope class.
The first TAutoVal item of TAutoArgs holds the return value.
Definition autodefs.h:1263
virtual TAutoVal * GetArgs()
Definition autodefs.h:1273
TAutoVal Args[N+1]
Definition autodefs.h:1264
static TAutoType ClassInfo
Definition autodefs.h:262
static TAutoType ClassInfo
Definition autodefs.h:263
static TAutoType ClassInfo
Definition autodefs.h:272
static TAutoType ClassInfo
Definition autodefs.h:285
owl::uint32 Lo
Definition autodefs.h:254
owl::int32 Hi
Definition autodefs.h:255
static TAutoType ClassInfo
Definition autodefs.h:259
static TAutoType ClassInfo
Definition autodefs.h:280
TAutoDate(double d)
Definition autodefs.h:246
static TAutoType ClassInfo
Definition autodefs.h:249
static TAutoType ClassInfo
Definition autodefs.h:281
TAutoDispId(TAutoProxy *, long id)
Definition autodefs.h:1332
TAutoDispId(TAutoProxy *prx, LPCTSTR name)
Definition autodefs.h:1331
TAutoDispIds(TAutoProxy *prx, LPCTSTR names)
Definition autodefs.h:1340
static TAutoType ClassInfo
Definition autodefs.h:274
static TAutoType ClassInfo
Definition autodefs.h:269
static TAutoType ClassInfo
Definition autodefs.h:279
owl::TLocaleString Name
Name of symbol, enumeration text.
Definition autodefs.h:896
T Val
Enumeration internal value.
Definition autodefs.h:897
static TAutoType ClassInfo
Definition autodefs.h:270
static TAutoType ClassInfo
Definition autodefs.h:278
static TAutoType ClassInfo
Definition autodefs.h:271
static TAutoType ClassInfo
Definition autodefs.h:277
static TAutoType ClassInfo
Definition autodefs.h:284
static TAutoType ClassInfo
Definition autodefs.h:268
static TAutoType ClassInfo
Definition autodefs.h:276
static TAutoType ClassInfo
Definition autodefs.h:282
Symbol table element.
Definition autodefs.h:404
owl::uint16 GetDataType() const
Definition autodefs.h:1528
bool IsByRef() const
Definition autodefs.h:1516
TAutoCommandBuildDtr BuildDtr
terminator only: destructor command builder
Definition autodefs.h:418
bool IsIterator() const
Definition autodefs.h:1522
void * DefaultArg
asArgument: default value, extends to 8 bytes
Definition autodefs.h:419
void SetFlag(owl::uint16 mask)
Definition autodefs.h:1501
short SymCount
asClass only: symbol count, 0 = uncounted yet
Definition autodefs.h:410
TAutoSymTypeConvert Convert
asFactory/asClass: function to perform cast
Definition autodefs.h:417
TAutoClass * GetClass() const
Definition autodefs.h:1531
long DispId
reserved dispatch ID, if not 0
Definition autodefs.h:409
static TAutoCommandBuild InitAutoIterator(TAutoIteratorBuild f)
Definition autodefs.h:1539
bool TestFlag(owl::uint16 mask) const
Definition autodefs.h:1507
bool IsEnum() const
Definition autodefs.h:1513
static TAutoCommandBuild InitTypeConvert(TAutoSymTypeConvert f)
Definition autodefs.h:1537
TAutoIteratorBuild BuildIter
asIterator only: address of iterator builder
Definition autodefs.h:416
void ClearFlag(owl::uint16 mask)
Definition autodefs.h:1504
owl::TLocaleString Name
name of symbol, initially untranslated
Definition autodefs.h:405
owl::uint32 Attr
attributes: enum AutoSymFlag, as???? (could be owl::uint16)
Definition autodefs.h:407
unsigned short TypeFlags
class symbol only (terminator)
Definition autodefs.h:411
owl::ulong HelpId
help context ID, not for asArgument
Definition autodefs.h:421
TAutoCommandBuild Build
asAnyCommand only: address of command builder
Definition autodefs.h:415
owl::uint16 GetFlags() const
Definition autodefs.h:1510
owl::TLocaleString Doc
documentation string, initially untranslated
Definition autodefs.h:406
TAutoEnum * GetEnum() const
Definition autodefs.h:1534
bool IsArray() const
Definition autodefs.h:1519
bool IsTerminator() const
Definition autodefs.h:1525
static TAutoCommandBuild InitAutoDestructor(TAutoCommandBuildDtr f)
Definition autodefs.h:1541
TAutoType * Type
pointer to class/type/enum descriptor
Definition autodefs.h:413
owl::uint16 Type
Definition autodefs.h:144
owl::uint16 GetType() const
Definition autodefs.h:143
static TAutoType ClassInfo
Definition autodefs.h:273
static TAutoType ClassInfo
Definition autodefs.h:275
static TAutoType ClassInfo
Definition autodefs.h:283
static TAutoType ClassInfo
Definition autodefs.h:226
Precursor to TServedObject containing object info.
Definition autodefs.h:451
const void * MostDerived()
Definition autodefs.h:454
TAutoClass * Class
class descriptor, contains type info
Definition autodefs.h:453
const void * Object
< ONLY for use when storing in TAutoVal union
Definition autodefs.h:452
TObjectDescriptor(const void *obj, TAutoClass &classobj, TDestruct destruct=Quiet)
Definition autodefs.h:477
@ Delete
automation object deletes the C++ object serviced
Definition autodefs.h:473
@ Quiet
behavior when an automation helper is freed
Definition autodefs.h:472
static ObjectPtr Cast(ObjectPtr from)
Definition autodefs.h:91
Undefined default template for dispatchers Template specialization is used to allow the compiler to l...
Definition dispatch.h:258
Designed to provide support for localized registration parameters, the TLocaleString Struct defines a...
Definition lclstrng.h:68
static TLangId UserDefaultLangId
The user-defined default language identifier.
Definition lclstrng.h:87
const tchar * Translate(TLangId lang)
translate string
Definition locale.cpp:344