OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
ocf::TAppDescriptor Class Reference

#include <ocf/appdesc.h>

Inheritance diagram for ocf::TAppDescriptor:

Public Member Functions

 TAppDescriptor (owl::TRegList &regInfo, TComponentFactory callback, owl::tstring &cmdLine, owl::TModule *module=&owl::GetGlobalModule(), const owl::TRegLink *regLink=0, owl::uint32 preselectedOptions=0)
 
 TAppDescriptor (owl::TRegList &regInfo, TComponentFactory callback, TLicenseKeyFactory *factory, owl::tstring &cmdLine, owl::TModule *module=&owl::GetGlobalModule(), const owl::TRegLink *regLink=0, owl::uint32 preselectedOptions=0)
 
 ~TAppDescriptor ()
 
 operator IUnknown * ()
 
bool IsAutomated () const
 
TComponentFactory GetFactory () const
 
const owl::TRegLinkGetRegLinkHead () const
 
const TLicenseKeyFactoryGetLicKeyFactory () const
 
void ProcessCmdLine (owl::tstring &cmdLine)
 Processes known options on the command line.
 
void SetLangId (owl::TLangId prevLang, LPCTSTR langIdStr)
 
bool IsOptionSet (owl::uint32 option) const
 
owl::uint32 GetOptions () const
 
void SetOption (owl::uint32 bit, bool state)
 
void RegisterClass ()
 Register an EXE class object with OLE so that other applications can connect to it.
 
void UnregisterClass ()
 Invalidates application class registered earlier with 'RegisterClass'.
 
bool RegisterObject (TObjectDescriptor app)
 Registers the helper object (TServedObject) of the class described via the 'app' parameter as the active object for its classId.
 
void UnregisterObject ()
 Invalidates a helper object registers with RegisterObject earlier.
 
TClassId GetLinkGuid (int index)
 Returns the GUID allocated as the specified index.
 
void RegisterServer (owl::TLangId lang, LPCTSTR regFile=0)
 Writes application and type library information to the given file.
 
void UnregisterServer (owl::TLangId lang=0, LPCTSTR str=0)
 Removes all application and type library information from the registry.
 
void MakeTypeLib (owl::TLangId lang, LPCTSTR str=0)
 Writes a type library description for this application to the given file.
 
void MergeAutoClasses ()
 
ITypeLib * GetTypeLibrary ()
 Returns the 'ITypeLib' interface pointer describing the objects exposed by this instance of 'TAppDescriptor'.
 
ITypeInfoCreateITypeInfo (TAutoClass &cls)
 
int GetClassCount ()
 
owl::TLangId GetAppLang ()
 
int GetClassIndex (TAutoClass *cls)
 Returns the index of a 'TAutoClass' instance.
 
bool GetClassId (TAutoClass *cls, GUID &retId)
 Retrieves the GUID of the specified TAutoClass instance.
 
TAutoClassGetAutoClass (unsigned index)
 Returns the TAutoClass instance as the specified index.
 
TAutoClassGetAutoClass (const GUID &clsid)
 Returns the TAutoClass instance assigned the specified GUID.
 
owl::TRegLinkGetRegLink (const GUID &clsid)
 Get the document template with the given GUID.
 
owl::uint16 GetVersionField (owl::uint field)
 Returns version as a whole number.
 
LPCTSTR GetAppName (owl::TLangId lang)
 
LPCTSTR GetAppDoc (owl::TLangId lang)
 
LPCTSTR GetHelpFile (owl::TLangId lang)
 
void WriteTypeLibrary (owl::TLangId lang, LPCTSTR file)
 
TUnknownCreateAutoApp (TObjectDescriptor app, owl::uint32 options, IUnknown *outer=0)
 Creates a TServedObject helper object which implements an IDispatch implementation on behalf of the 'Application' object.
 
void ReleaseAutoApp (TObjectDescriptor app)
 Releases the helper object (TServedObject) implementing IDispatch on behalf of the 'Application' object.
 
TUnknownCreateAutoObject (TObjectDescriptor obj, TServedObject &app, IUnknown *outer=0)
 Creates a TServedObject helper which implements IDispatch on behalf of the class described via the 'objDesc' parameter.
 
TUnknownCreateAutoObject (const void *obj, const std::type_info &objInfo, const void *app, const std::type_info &appInfo, IUnknown *outer=0)
 Creates a TServedObject helper which implements IDispatch on behalf of the class instance passed in via 'obj' and 'objInfo' parameters.
 
TServedObjectFindServed (const void *mostDerivedObj)
 
TServedObjectFindServed (TObjectDescriptor &objDesc)
 
void AddServed (TServedObject &obj)
 
void RemoveServed (TServedObject &obj)
 
void InvalidateObject (const void *obj)
 
void ReleaseObject (const void *obj)
 
bool IsBound ()
 
bool IsActiveObject (TServedObject *obj)
 
void FlushServed ()
 
void DeleteCreator ()
 
HRESULT _IFUNC CreateInstance (IUnknown *outer, const IID &iid, void **retObject)
 
HRESULT _IFUNC LockServer (int lock)
 
HRESULT _IFUNC GetLicInfo (LICINFO *licInfo)
 
HRESULT _IFUNC RequestLicKey (DWORD reserved, BSTR *retKey)
 
HRESULT _IFUNC CreateInstanceLic (IUnknown *outer, IUnknown *reserved, const IID &iid, BSTR key, void **retObject)
 

Public Attributes

TBaseClassId AppClassId
 

Friends

class _ICLASS TTypeLibrary
 
class _ICLASS TCoClassInfo
 
TAppDescriptorGetAppDescriptor ()
 

Detailed Description

Definition at line 52 of file appdesc.h.

Constructor & Destructor Documentation

◆ TAppDescriptor() [1/2]

ocf::TAppDescriptor::TAppDescriptor ( owl::TRegList & regInfo,
TComponentFactory callback,
owl::tstring & cmdLine,
owl::TModule * module = owl::GetGlobalModule(),
const owl::TRegLink * regLink = 0,
owl::uint32 preselectedOptions = 0 )

Definition at line 39 of file appdesc.cpp.

References ProcessCmdLine().

◆ TAppDescriptor() [2/2]

ocf::TAppDescriptor::TAppDescriptor ( owl::TRegList & regInfo,
TComponentFactory callback,
TLicenseKeyFactory * factory,
owl::tstring & cmdLine,
owl::TModule * module = owl::GetGlobalModule(),
const owl::TRegLink * regLink = 0,
owl::uint32 preselectedOptions = 0 )

Definition at line 57 of file appdesc.cpp.

References ProcessCmdLine().

◆ ~TAppDescriptor()

ocf::TAppDescriptor::~TAppDescriptor ( )

Definition at line 140 of file appdesc.cpp.

References ocf::amExeModule, and UnregisterClass().

Member Function Documentation

◆ AddServed()

void ocf::TAppDescriptor::AddServed ( TServedObject & obj)

Definition at line 620 of file appdesc.cpp.

◆ CreateAutoApp()

TUnknown * ocf::TAppDescriptor::CreateAutoApp ( TObjectDescriptor app,
owl::uint32 options,
IUnknown * outer = 0 )

Creates a TServedObject helper object which implements an IDispatch implementation on behalf of the 'Application' object.

Definition at line 162 of file appdesc.cpp.

References ocf::amAutomation, ocf::amExeMode, ocf::amServedApp, ocf::TServedObjectCreator::CreateObject(), ocf::TObjectDescriptor::Delete, ocf::TObjectDescriptor::PostQuit, ocf::TObjectDescriptor::Quiet, and RegisterObject().

◆ CreateAutoObject() [1/2]

TUnknown * ocf::TAppDescriptor::CreateAutoObject ( const void * obj,
const std::type_info & objInfo,
const void * app,
const std::type_info & appInfo,
IUnknown * outer = 0 )

Creates a TServedObject helper which implements IDispatch on behalf of the class instance passed in via 'obj' and 'objInfo' parameters.

Definition at line 215 of file appdesc.cpp.

References FindServed(), and ocf::MostDerived().

◆ CreateAutoObject() [2/2]

TUnknown * ocf::TAppDescriptor::CreateAutoObject ( TObjectDescriptor objDesc,
TServedObject & app,
IUnknown * outer = 0 )

Creates a TServedObject helper which implements IDispatch on behalf of the class described via the 'objDesc' parameter.

Note
The returned object initial ref. count is '0'.

Definition at line 205 of file appdesc.cpp.

◆ CreateInstance()

HRESULT _IFUNC ocf::TAppDescriptor::CreateInstance ( IUnknown * outer,
const IID & iid,
void ** retObject )

◆ CreateInstanceLic()

HRESULT _IFUNC ocf::TAppDescriptor::CreateInstanceLic ( IUnknown * outer,
IUnknown * reserved,
const IID & iid,
BSTR key,
void ** retObject )

Definition at line 364 of file appdesc.cpp.

References CreateInstance(), and ocf::TLicenseKeyFactory::QueryLicKey().

◆ CreateITypeInfo()

ITypeInfo * ocf::TAppDescriptor::CreateITypeInfo ( TAutoClass & cls)

Definition at line 696 of file appdesc.cpp.

References ocf::TServedObject::Creator.

◆ DeleteCreator()

void ocf::TAppDescriptor::DeleteCreator ( )

Definition at line 655 of file appdesc.cpp.

◆ FindServed() [1/2]

TServedObject * ocf::TAppDescriptor::FindServed ( const void * mostDerivedObj)

Definition at line 593 of file appdesc.cpp.

References ocf::TServedObject::RootObject.

◆ FindServed() [2/2]

TServedObject * ocf::TAppDescriptor::FindServed ( TObjectDescriptor & objDesc)

Definition at line 606 of file appdesc.cpp.

References FindServed().

◆ FlushServed()

void ocf::TAppDescriptor::FlushServed ( )

Definition at line 644 of file appdesc.cpp.

◆ GetAppDoc()

LPCTSTR ocf::TAppDescriptor::GetAppDoc ( owl::TLangId lang)
inline

Definition at line 111 of file appdesc.h.

◆ GetAppLang()

owl::TLangId ocf::TAppDescriptor::GetAppLang ( )
inline

Definition at line 103 of file appdesc.h.

◆ GetAppName()

LPCTSTR ocf::TAppDescriptor::GetAppName ( owl::TLangId lang)
inline

Definition at line 110 of file appdesc.h.

◆ GetAutoClass() [1/2]

TAutoClass * ocf::TAppDescriptor::GetAutoClass ( const GUID & clsid)

Returns the TAutoClass instance assigned the specified GUID.

Definition at line 532 of file appdesc.cpp.

References AppClassId, and ocf::TBaseClassId::GetOffset().

◆ GetAutoClass() [2/2]

TAutoClass * ocf::TAppDescriptor::GetAutoClass ( unsigned index)

Returns the TAutoClass instance as the specified index.

Definition at line 522 of file appdesc.cpp.

◆ GetClassCount()

int ocf::TAppDescriptor::GetClassCount ( )
inline

Definition at line 102 of file appdesc.h.

◆ GetClassId()

bool ocf::TAppDescriptor::GetClassId ( TAutoClass * cls,
GUID & retId )

Retrieves the GUID of the specified TAutoClass instance.

Note
Passing '0' as the 'cls' return the GUID of the type Library.

Returns 'true' if successful, or 'false' otherwise.

Definition at line 489 of file appdesc.cpp.

References AppClassId, and GetClassIndex().

◆ GetClassIndex()

int ocf::TAppDescriptor::GetClassIndex ( TAutoClass * cls)

Returns the index of a 'TAutoClass' instance.

Definition at line 473 of file appdesc.cpp.

◆ GetFactory()

TComponentFactory ocf::TAppDescriptor::GetFactory ( ) const
inline

Definition at line 65 of file appdesc.h.

◆ GetHelpFile()

LPCTSTR ocf::TAppDescriptor::GetHelpFile ( owl::TLangId lang)
inline

Definition at line 112 of file appdesc.h.

◆ GetLicInfo()

HRESULT _IFUNC ocf::TAppDescriptor::GetLicInfo ( LICINFO * licInfo)

Definition at line 345 of file appdesc.cpp.

References ocf::TLicenseKeyFactory::GetLicInfo().

◆ GetLicKeyFactory()

const TLicenseKeyFactory * ocf::TAppDescriptor::GetLicKeyFactory ( ) const
inline

Definition at line 67 of file appdesc.h.

◆ GetLinkGuid()

TClassId ocf::TAppDescriptor::GetLinkGuid ( int index)

Returns the GUID allocated as the specified index.

Note
Will allocate a new GUID if 'index' has not been allocated yet.

Definition at line 508 of file appdesc.cpp.

References ocf::TBaseClassId::AllocId(), and AppClassId.

◆ GetOptions()

owl::uint32 ocf::TAppDescriptor::GetOptions ( ) const
inline

Definition at line 74 of file appdesc.h.

◆ GetRegLink()

TRegLink * ocf::TAppDescriptor::GetRegLink ( const GUID & clsid)

Get the document template with the given GUID.

Definition at line 548 of file appdesc.cpp.

References GetLinkGuid().

◆ GetRegLinkHead()

const owl::TRegLink * ocf::TAppDescriptor::GetRegLinkHead ( ) const
inline

Definition at line 66 of file appdesc.h.

◆ GetTypeLibrary()

ITypeLib * ocf::TAppDescriptor::GetTypeLibrary ( )

Returns the 'ITypeLib' interface pointer describing the objects exposed by this instance of 'TAppDescriptor'.

Definition at line 574 of file appdesc.cpp.

References TTypeLibrary.

◆ GetVersionField()

uint16 ocf::TAppDescriptor::GetVersionField ( owl::uint field)

Returns version as a whole number.

Definition at line 379 of file appdesc.cpp.

References _T.

◆ InvalidateObject()

void ocf::TAppDescriptor::InvalidateObject ( const void * obj)

◆ IsActiveObject()

bool ocf::TAppDescriptor::IsActiveObject ( TServedObject * obj)
inline

Definition at line 132 of file appdesc.h.

◆ IsAutomated()

bool ocf::TAppDescriptor::IsAutomated ( ) const
inline

Definition at line 64 of file appdesc.h.

◆ IsBound()

bool ocf::TAppDescriptor::IsBound ( )
inline

Definition at line 131 of file appdesc.h.

◆ IsOptionSet()

bool ocf::TAppDescriptor::IsOptionSet ( owl::uint32 option) const
inline

Definition at line 73 of file appdesc.h.

◆ LockServer()

HRESULT _IFUNC ocf::TAppDescriptor::LockServer ( int lock)

Definition at line 327 of file appdesc.cpp.

References _T, HR_NOERROR, and TRACEX.

◆ MakeTypeLib()

void ocf::TAppDescriptor::MakeTypeLib ( owl::TLangId lang,
LPCTSTR typeLibName = 0 )

Writes a type library description for this application to the given file.

Exceptions
TXRegistrymay be thrown, if access to the registry is denied, unless the option amQuietReg is specified, in which case such exceptions will be suppressed. Note that amQuietReg will also suppress any other exception derived from TXBase.

Definition at line 905 of file appdesc.cpp.

References _MAX_PATH, _T, ocf::amQuietReg, AppClassId, COUNTOF, owl::TRegKey::GetClassesRoot(), IsOptionSet(), TRACEX, WARNX, and WriteTypeLibrary().

◆ MergeAutoClasses()

void ocf::TAppDescriptor::MergeAutoClasses ( )

Definition at line 1101 of file appdesc.cpp.

References ocf::TBaseClassId::AllocId(), and AppClassId.

◆ operator IUnknown *()

ocf::TAppDescriptor::operator IUnknown * ( )
inline

Definition at line 63 of file appdesc.h.

◆ ProcessCmdLine()

void ocf::TAppDescriptor::ProcessCmdLine ( owl::tstring & cmdLine)

Processes known options on the command line.

Registry options (one allowed):

  • RegServer [<regfile>]
  • UnregServer/Unregister
  • NoRegValidate

Auxiliary options:

  • Automation
  • Debug
  • Embedding
  • Language <langid>
  • QuietReg
  • TypeLib [<name>]

On return, the given cmdLine will have the processed options removed.

Note
If no registry option (RegServer, UnregServer or NoRegValidate) is specified on the command line, then validation of the registry entries will be performed. If validation fails, then the registry is updated as if registration was specified. Pass NoRegValidate to suppress this behaviour.
Exceptions
TXRegistrymay be thrown, if access to the registry is denied, unless the option QuietReg is specified, in which case such exceptions will be suppressed. Note that QuietReg will also suppress any other exception derived from TXBase.

Definition at line 977 of file appdesc.cpp.

References _T, _tcsicmp, ocf::amAutomation, ocf::amDebug, ocf::amEmbedding, ocf::amExeModule, ocf::amLangId, ocf::amNoRegValidate, ocf::amQuietReg, ocf::amRegServer, ocf::amSingleUse, ocf::amTypeLib, ocf::amUnregServer, CHECKX, owl::TCmdLine::Done, IsOptionSet(), MakeTypeLib(), owl::TCmdLine::Option, RegisterServer(), SetLangId(), SetOption(), owl::to_tstring(), UnregisterServer(), owl::TCmdLine::Value, and WARNX.

◆ RegisterClass()

void ocf::TAppDescriptor::RegisterClass ( )

Register an EXE class object with OLE so that other applications can connect to it.

Definition at line 399 of file appdesc.cpp.

References _T, ocf::amDebug, ocf::amSingleUse, AppClassId, IsOptionSet(), and OLECALL.

◆ RegisterObject()

bool ocf::TAppDescriptor::RegisterObject ( TObjectDescriptor app)

Registers the helper object (TServedObject) of the class described via the 'app' parameter as the active object for its classId.

Definition at line 427 of file appdesc.cpp.

References _T, ocf::amDebug, AppClassId, FindServed(), IsOptionSet(), and OLECALL.

◆ RegisterServer()

void ocf::TAppDescriptor::RegisterServer ( owl::TLangId lang,
LPCTSTR regFilename = 0 )

Writes application and type library information to the given file.

If the given regFilename is nullptr, then the information is written to the registry.

Exceptions
TXRegistrymay be thrown, if access to the registry is denied, unless the option amQuietReg is specified, in which case such exceptions will be suppressed. Note that amQuietReg will also suppress any other exception derived from TXBase.

Definition at line 720 of file appdesc.cpp.

References _T, _tcscpy, _USES_CONVERSION, _W2A, ocf::amExeModule, ocf::amQuietReg, ocf::amRegServer, ocf::amUnregServer, AppClassId, ocf::AppDebugFilter, ocf::DebugRegCount, ocf::DocDebugFilter, owl::TRegKey::GetClassesRoot(), GetLinkGuid(), IsOptionSet(), ocf::OcRegisterClass(), ocf::OcRegistryUpdate(), ocf::OcRegistryValidate(), ocf::OcRegNoDebug, ocf::OcRegNotDll, ocf::OcSetupDebugReg(), SetOption(), TRACEX, and WARNX.

◆ ReleaseAutoApp()

void ocf::TAppDescriptor::ReleaseAutoApp ( TObjectDescriptor app)

Releases the helper object (TServedObject) implementing IDispatch on behalf of the 'Application' object.

Definition at line 193 of file appdesc.cpp.

References FindServed(), and UnregisterObject().

◆ ReleaseObject()

void ocf::TAppDescriptor::ReleaseObject ( const void * obj)

◆ RemoveServed()

void ocf::TAppDescriptor::RemoveServed ( TServedObject & obj)

Definition at line 633 of file appdesc.cpp.

◆ RequestLicKey()

HRESULT _IFUNC ocf::TAppDescriptor::RequestLicKey ( DWORD reserved,
BSTR * retKey )

Definition at line 355 of file appdesc.cpp.

References ocf::TLicenseKeyFactory::RequestLicKey().

◆ SetLangId()

void ocf::TAppDescriptor::SetLangId ( owl::TLangId prevLang,
LPCTSTR langIdStr )

Definition at line 707 of file appdesc.cpp.

◆ SetOption()

void ocf::TAppDescriptor::SetOption ( owl::uint32 bit,
bool state )
inline

Definition at line 75 of file appdesc.h.

◆ UnregisterClass()

void ocf::TAppDescriptor::UnregisterClass ( )

Invalidates application class registered earlier with 'RegisterClass'.

Definition at line 415 of file appdesc.cpp.

References _T, and OLECALL.

◆ UnregisterObject()

void ocf::TAppDescriptor::UnregisterObject ( )

Invalidates a helper object registers with RegisterObject earlier.

Definition at line 459 of file appdesc.cpp.

References _T, and OLECALL.

◆ UnregisterServer()

void ocf::TAppDescriptor::UnregisterServer ( owl::TLangId lang = 0,
LPCTSTR str = 0 )

Removes all application and type library information from the registry.

Exceptions
TXRegistrymay be thrown, if access to the registry is denied, unless the option amQuietReg is specified, in which case such exceptions will be suppressed. Note that amQuietReg will also suppress any other exception derived from TXBase.

Definition at line 850 of file appdesc.cpp.

References _T, ocf::amQuietReg, AppClassId, owl::TRegKey::DeleteKey(), owl::TRegKey::GetClassesRoot(), GetLinkGuid(), owl::TRegKey::HasSubkey(), IsOptionSet(), ocf::OcUnregisterClass(), TRACEX, and WARNX.

◆ WriteTypeLibrary()

Friends And Related Symbol Documentation

◆ GetAppDescriptor

TAppDescriptor * GetAppDescriptor ( )
friend

Definition at line 203 of file appdesc.h.

◆ TCoClassInfo

Definition at line 195 of file appdesc.h.

◆ TTypeLibrary

Definition at line 194 of file appdesc.h.

Member Data Documentation

◆ AppClassId

TBaseClassId ocf::TAppDescriptor::AppClassId

Definition at line 136 of file appdesc.h.


The documentation for this class was generated from the following files: