8#if !defined(OCF_OCREG_H)
12#if defined(BI_HAS_PRAGMA_ONCE)
23namespace ocf {
class TRegistrar; }
123 TUnknown* CreateAutoObject(
const void* obj,
const std::type_info& objInfo,
124 const void* app,
const std::type_info& appInfo,
127 virtual void* GetFactory(
const GUID& clsid,
const GUID&
iid);
128 virtual bool CanUnload();
133 virtual void Shutdown(IUnknown* releasedObj,
owl::uint32 options);
141 void RegisterAppClass();
142 void UnregisterAppClass();
185template <
class T> IUnknown*
194 objPtr->SetOuter(outer);
198 return objPtr->operator IUnknown*();
211 static int RunApp(T* app);
225 T* app =
new T(hInst, options);
232template <
class T>
int
236 while(GetMessage(&msg, 0, 0, 0)) {
237 TranslateMessage(&msg);
238 DispatchMessage(&msg);
246template <
class T>
void
255template <
class T> IUnknown*
275 if (options &
amRun) {
284#if !defined(OCF_APPDESC_H)
318 const void* app,
const std::type_info& appInfo,
TAppDescriptor - OLE application descriptor definitions.
OLE Automation Class Definitions.
void ProcessCmdLine(owl::tstring &cmdLine)
Processes known options on the command line.
void SetOption(owl::uint32 bit, bool state)
bool IsOptionSet(owl::uint32 option) const
void RegisterClass()
Register an EXE class object with OLE so that other applications can connect to it.
TUnknown * CreateAutoApp(TObjectDescriptor app, owl::uint32 options, IUnknown *outer=0)
Creates a TServedObject helper object which implements an IDispatch implementation on behalf of the '...
TUnknown * CreateAutoObject(TObjectDescriptor obj, TServedObject &app, IUnknown *outer=0)
Creates a TServedObject helper which implements IDispatch on behalf of the class described via the 'o...
void UnregisterClass()
Invalidates application class registered earlier with 'RegisterClass'.
owl::uint32 GetOptions() const
void ReleaseAutoApp(TObjectDescriptor app)
Releases the helper object (TServedObject) implementing IDispatch on behalf of the 'Application' obje...
Simple factory for Automation Server.
static IUnknown * Create(IUnknown *outer, owl::uint32 options, owl::uint32 id)
Main Create callback function called to create app.
static T * CreateApp(HINSTANCE hInst, owl::uint32 options)
Called when the app is not found and needs to be created.
static int RunApp(T *app)
Called to run the application message loop if an EXE, or DLL in amExeMode.
static void DestroyApp(T *app)
Called to destroy the application previously created.
Simple factor for COM Servers.
static IUnknown * Create(IUnknown *outer, owl::uint32 options, owl::uint32 id)
Main Create callback function called to create COM object.
Application registration manager interface class.
TUnknown * CreateAutoApp(TObjectDescriptor app, owl::uint32 options, IUnknown *outer=0)
bool IsOptionSet(owl::uint32 option) const
TAppDescriptor & GetAppDescriptor()
void SetOption(owl::uint32 bit, bool state)
void UnregisterAppClass()
void ProcessCmdLine(owl::tstring &cmdLine)
TUnknown * CreateAutoObject(TObjectDescriptor doc, TServedObject &app, IUnknown *outer=0)
owl::uint32 GetOptions() const
void ReleaseAutoApp(TObjectDescriptor app)
OLE object exposed for automated access of internal object.
Standard implementation of a controlling IUnknown for an object, to be inherited with other COM inter...
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Smart pointer to a single object. Provides member access operator ->
static auto GetClassesRoot() -> TRegKey &
Special predefined root key used by shell and OLE applications (HKEY_CLASSES_ROOT).
A registration parameter table, composed of a list of TRegItems.
static void Update(TRegKey &baseKey, tistream &in)
Writes lines to registry.
static int Validate(TRegKey &baseKey, tistream &in)
Returns number of mismatched entries.
Object Component Framework (COM encapsulation)
int OcRegistryValidate(owl::tistream &in)
IUnknown *(* TComponentFactory)(IUnknown *outer, owl::uint32 options, owl::uint32 id)
int OcSetupDebugReg(owl::TRegList ®Info, owl::TRegItem *regDebug, owl::TLangId lang, TCHAR *clsid)
Walk thru a reginfo list using debug entries to create a parallel non-debug set for alternate,...
void OcRegistryUpdate(owl::tistream &in)
owl::TRegItem OcRegNotDll[]
owl::TRegItem OcRegNoDebug[]
long OcRegisterClass(owl::TRegList ®Info, owl::TModule *module, owl::tostream &out, owl::TLangId lang, LPCTSTR filter=0, owl::TRegItem *defaults=0, owl::TRegItem *overrides=0)
Generate OLE registration file image to an output stream.
TOcAppMode
Application running mode and registration flags these are initialized when processing command line or...
@ amAutomation
set from cmdline when EXE lauched for automation
@ amQuietReg
suppress error UI during registration processing
@ amTypeLib
requested typelib to be generated and registered
@ amRegServer
complete registration database update requested
@ amUnregServer
registration database unregistration requested
@ amShutdown
set in factory call to shutdown/delete app
@ amSingleUse
set from app reg, may be forced on per instance
@ amServedApp
per instance flag, app refcnt held by container
@ amLangId
user registration requested a particular LangId
@ amExeMode
may be overridden per instance if running DLL
@ amExeModule
set for EXE components, 0 if DLL inproc server
@ amDebug
user requested launching for debugging
@ amNoRegValidate
user request to suppress registry validation
@ amEmbedding
cmdline, overridden per Instance if embedded DLL
@ amRun
set in factory call to run application msg loop
class _ICLASS TAppDescriptor
int OcUnregisterClass(owl::TRegList ®Info, owl::TRegItem *overrides=0)
Unregister application or class from registration database.
owl::uint16 TLangId
Holds a language ID, a predefined number that represents a base language and dialect.
TModule & GetGlobalModule()
owl::TPointer< ocf::TRegistrar > Registrar
Global registrar object defined by the client application.
Various types of smart pointer templatized classes.
General Registry access & registration implementation TRegKey, TRegValue, TRegKeyIterator,...
A single registration list entry.