OWLNext 7.0
Borland's Object Windows Library for the modern age
|
#include <ocf/appdesc.h>
Public Member Functions | |
TAppDescriptor (owl::TRegList ®Info, TComponentFactory callback, owl::tstring &cmdLine, owl::TModule *module=&owl::GetGlobalModule(), const owl::TRegLink *regLink=0, owl::uint32 preselectedOptions=0) | |
TAppDescriptor (owl::TRegList ®Info, 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::TRegLink * | GetRegLinkHead () const |
const TLicenseKeyFactory * | GetLicKeyFactory () 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'. | |
ITypeInfo * | CreateITypeInfo (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. | |
TAutoClass * | GetAutoClass (unsigned index) |
Returns the TAutoClass instance as the specified index. | |
TAutoClass * | GetAutoClass (const GUID &clsid) |
Returns the TAutoClass instance assigned the specified GUID. | |
owl::TRegLink * | GetRegLink (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) |
TUnknown * | 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. | |
void | ReleaseAutoApp (TObjectDescriptor app) |
Releases the helper object (TServedObject) implementing IDispatch on behalf of the 'Application' object. | |
TUnknown * | CreateAutoObject (TObjectDescriptor obj, TServedObject &app, IUnknown *outer=0) |
Creates a TServedObject helper which implements IDispatch on behalf of the class described via the 'objDesc' parameter. | |
TUnknown * | 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. | |
TServedObject * | FindServed (const void *mostDerivedObj) |
TServedObject * | FindServed (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 |
TAppDescriptor * | GetAppDescriptor () |
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().
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().
ocf::TAppDescriptor::~TAppDescriptor | ( | ) |
Definition at line 140 of file appdesc.cpp.
References ocf::amExeModule, and UnregisterClass().
void ocf::TAppDescriptor::AddServed | ( | TServedObject & | obj | ) |
Definition at line 620 of file appdesc.cpp.
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().
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().
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.
Definition at line 205 of file appdesc.cpp.
HRESULT _IFUNC ocf::TAppDescriptor::CreateInstance | ( | IUnknown * | outer, |
const IID & | iid, | ||
void ** | retObject ) |
Definition at line 271 of file appdesc.cpp.
References ocf::amExeMode, ocf::amRun, ocf::amServedApp, ocf::amSingleUse, HR_FAIL, HR_NOERROR, HR_OK, HR_OUTOFMEMORY, and UnregisterClass().
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().
ITypeInfo * ocf::TAppDescriptor::CreateITypeInfo | ( | TAutoClass & | cls | ) |
Definition at line 696 of file appdesc.cpp.
References ocf::TServedObject::Creator.
void ocf::TAppDescriptor::DeleteCreator | ( | ) |
Definition at line 655 of file appdesc.cpp.
TServedObject * ocf::TAppDescriptor::FindServed | ( | const void * | mostDerivedObj | ) |
Definition at line 593 of file appdesc.cpp.
References ocf::TServedObject::RootObject.
TServedObject * ocf::TAppDescriptor::FindServed | ( | TObjectDescriptor & | objDesc | ) |
Definition at line 606 of file appdesc.cpp.
References FindServed().
void ocf::TAppDescriptor::FlushServed | ( | ) |
Definition at line 644 of file appdesc.cpp.
|
inline |
|
inline |
|
inline |
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().
TAutoClass * ocf::TAppDescriptor::GetAutoClass | ( | unsigned | index | ) |
Returns the TAutoClass instance as the specified index.
Definition at line 522 of file appdesc.cpp.
bool ocf::TAppDescriptor::GetClassId | ( | TAutoClass * | cls, |
GUID & | retId ) |
Retrieves the GUID of the specified TAutoClass instance.
Returns 'true' if successful, or 'false' otherwise.
Definition at line 489 of file appdesc.cpp.
References AppClassId, and GetClassIndex().
int ocf::TAppDescriptor::GetClassIndex | ( | TAutoClass * | cls | ) |
Returns the index of a 'TAutoClass' instance.
Definition at line 473 of file appdesc.cpp.
|
inline |
|
inline |
Definition at line 345 of file appdesc.cpp.
References ocf::TLicenseKeyFactory::GetLicInfo().
|
inline |
Returns the GUID allocated as the specified index.
Definition at line 508 of file appdesc.cpp.
References ocf::TBaseClassId::AllocId(), and AppClassId.
|
inline |
Get the document template with the given GUID.
Definition at line 548 of file appdesc.cpp.
References GetLinkGuid().
|
inline |
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.
Definition at line 669 of file appdesc.cpp.
References FindServed(), ocf::TServedObject::Object, and ocf::TServedObject::RootObject.
|
inline |
|
inline |
Definition at line 327 of file appdesc.cpp.
References _T, HR_NOERROR, and TRACEX.
void ocf::TAppDescriptor::MakeTypeLib | ( | owl::TLangId | lang, |
LPCTSTR | typeLibName = 0 ) |
Writes a type library description for this application to the given file.
TXRegistry | may 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().
void ocf::TAppDescriptor::MergeAutoClasses | ( | ) |
Definition at line 1101 of file appdesc.cpp.
References ocf::TBaseClassId::AllocId(), and AppClassId.
void ocf::TAppDescriptor::ProcessCmdLine | ( | owl::tstring & | cmdLine | ) |
Processes known options on the command line.
Registry options (one allowed):
Auxiliary options:
On return, the given cmdLine
will have the processed options removed.
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.TXRegistry | may 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.
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.
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.
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.
TXRegistry | may 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.
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().
Definition at line 682 of file appdesc.cpp.
References FindServed(), ocf::TServedObject::Object, and ocf::TServedObject::RootObject.
void ocf::TAppDescriptor::RemoveServed | ( | TServedObject & | obj | ) |
Definition at line 633 of file appdesc.cpp.
Definition at line 355 of file appdesc.cpp.
References ocf::TLicenseKeyFactory::RequestLicKey().
void ocf::TAppDescriptor::SetLangId | ( | owl::TLangId | prevLang, |
LPCTSTR | langIdStr ) |
Definition at line 707 of file appdesc.cpp.
|
inline |
void ocf::TAppDescriptor::UnregisterClass | ( | ) |
Invalidates application class registered earlier with 'RegisterClass'.
Definition at line 415 of file appdesc.cpp.
void ocf::TAppDescriptor::UnregisterObject | ( | ) |
Invalidates a helper object registers with RegisterObject earlier.
Definition at line 459 of file appdesc.cpp.
void ocf::TAppDescriptor::UnregisterServer | ( | owl::TLangId | lang = 0, |
LPCTSTR | str = 0 ) |
Removes all application and type library information from the registry.
TXRegistry | may 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.
void ocf::TAppDescriptor::WriteTypeLibrary | ( | owl::TLangId | lang, |
LPCTSTR | file ) |
Definition at line 195 of file typelib.cpp.
References _MAX_PATH, _T, _tcscat, _tcscpy, AppClassId, owl::TFileName::Device, owl::TRegKey::GetClassesRoot(), owl::TModule::GetModuleFileName(), owl::TFileName::GetParts(), owl::TRegList::Lookup(), OLECALL, owl::TFileName::Path, owl::TFileName::Server, and TTypeLibrary.
|
friend |
TBaseClassId ocf::TAppDescriptor::AppClassId |