Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p6compif.h
Go to the documentation of this file.
1 
12 #ifndef P6COMPIF_H__
13 #define P6COMPIF_H__ 1
14 
15 #include "p6dllapi.h"
16 
17 namespace P6R {
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
27 
36  typedef struct
37  {
41 
50  typedef P6R::P6ERR (*P6CREATEINST)(P6R::p6ICom *pOuter,const P6R::IID &iid,P6R::P6VOID **ppNewComponent);
51 
62  typedef struct
63  {
64  const P6R::CID *m_pCID;
70 
71  typedef P6R::P6ERR (*P6DLLSTART)();
72  typedef P6R::P6ERR (*P6DLLEND)();
73 
74  typedef P6R::P6VOID (*CIDCB)(const P6R::CID& cid,P6R::P6VOID *pCtx);
80  interface p6IRegistrar : p6ICom
81  {
82  P6COMMETHOD registerComponent(const P6R::CID& cid,const P6R::P6WCHAR *pszName,const P6R::P6WCHAR *pszPathname) = 0;
86  P6COMMETHOD enumCIDs(CIDCB pfnCB,P6R::P6VOID *pCBCtx) = 0;
87  };
88  #define IF_p6IRegistrar {0x6BBCC514,0xF8BA,0x40b9,{0x9C,0x52,0x32,0x9D,0xBE,0x3F,0x5D,0x9E}}
89 
107  {
125  P6COMMETHOD next(P6R::P6UINT32 cElements,P6R::P6COMPONENTDATA *parElements,P6R::P6UINT32 *pcReturned) = 0;
126 
135  P6COMMETHOD reset() = 0;
136  };
137  /*{C2B56A58-4B7C-E1F9-C84E-4794FA242DC1}*/
138  #define IF_p6IEnumComponents {0xC2B56A58,0x4B7C,0xE1F9,{0xC8,0x4E,0x47,0x94,0xFA,0x24,0x2D,0xC1}}
139 
140 
141 
155  interface p6IModule : p6ICom
156  {
177  P6COMMETHOD initialize(const P6R::P6DLLAPI *pDllApi,const P6R::P6WCHAR *pwszFilename) = 0;
178 
189  P6COMMETHOD start() = 0;
190 
201  P6COMMETHOD end() = 0;
202 
209 
229  P6COMMETHOD getComponentFactory(const P6R::CID &cid,const P6R::IID &iid,P6R::P6VOID **ppIface) = 0;
230 
244 
258  P6COMMETHOD selfRegister(P6R::p6IRegistrar *pRegistrar) = 0;
259 
260 
270 
286  P6COMMETHOD getVersion(P6R::VERFIELDS nField,P6R::P6VERSION *pVersion) = 0;
287 
304  P6COMMETHOD getVersionLocale(P6R::P6CHAR *pBuffer,P6R::P6SIZE cBuffer) = 0;
305 
332  P6COMMETHOD getVersionString(P6R::VERSTRFIELDS nField,P6R::P6WCHAR *pBuffer,P6R::P6SIZE *pcBuffer) = 0;
333 
348  };
349  #define IF_p6IModule {0xB4573CD0,0x764C,0x458e,{0xAE,0x09,0x9C,0x5D,0x75,0xC5,0x26,0x0F}}
350 
363  interface p6IFactory : p6ICom
364  {
365  P6COMMETHOD createInstance(P6R::p6ICom *pOuter,const P6R::IID &iid,P6R::P6VOID **ppIface) = 0;
367  };
368  // {00000001-0000-0000-C000-000000000046}
369  #define IF_p6IFactory {0x00000001,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}}
370 
371 #ifdef __cplusplus
372 }
373 #endif
374 
375 } //namespace
376 
377 extern "C" P6R::P6ERR p6GlueGetIModule(const P6R::P6COMPONENTDATA *pCompDataArray,
378  const P6R::P6INT32 cCompDataArray,
379  P6R::P6INT32 *pcActiveComponents,
380  P6R::p6IModule **ppModule,
381  const P6R::P6VERINFO *pVerinfo,
382  P6R::P6DLLSTART pfnStart,
383  P6R::P6DLLSTART pfnEnd);
384 
385 #endif
size_t P6SIZE
Definition: p6types.h:62
virtual P6R::P6ERR getComponentFactory(const P6R::CID &cid, const P6R::IID &iid, P6R::P6VOID **ppIface)=0
Used to retrieve and instance of the modules component p6IFactory interface.
P6R::P6ERR(* P6DLLSTART)()
Definition: p6compif.h:71
virtual P6R::P6ERR unregisterAll()=0
unsigned int P6UINT32
Definition: p6types.h:40
virtual P6R::P6ERR getModuleInfo()=0
Currently unused/unimplemented.
virtual P6R::P6ERR start()=0
Called by the component loader (after initialize() has been successfully called) to execute any start...
virtual P6R::P6ERR lockServer(P6R::P6BOOL bLock)=0
virtual P6R::P6ERR getVersionLocale(P6R::P6CHAR *pBuffer, P6R::P6SIZE cBuffer)=0
This method is used to retrieve the locale string assosiated with the modules VERINFO string data...
P6R::P6ERR p6GlueGetIModule(const P6R::P6COMPONENTDATA *pCompDataArray, const P6R::P6INT32 cCompDataArray, P6R::P6INT32 *pcActiveComponents, P6R::p6IModule **ppModule, const P6R::P6VERINFO *pVerinfo, P6R::P6DLLSTART pfnStart, P6R::P6DLLSTART pfnEnd)
bool P6BOOL
Boolean type.
Definition: p6types.h:101
Component factory used to create instances of components.
Definition: p6compif.h:363
P6R::P6ERR(* P6DLLEND)()
Definition: p6compif.h:72
const P6R::CID * m_pCID
The component ID.
Definition: p6compif.h:64
virtual P6R::P6ERR createInstance(P6R::p6ICom *pOuter, const P6R::IID &iid, P6R::P6VOID **ppIface)=0
virtual P6R::P6ERR enumCIDs(CIDCB pfnCB, P6R::P6VOID *pCBCtx)=0
const P6R::P6WCHAR * m_pCategoryName
Definition: p6compif.h:39
Provides services to register a component with [p6]COM at runtime.
Definition: p6compif.h:80
virtual P6R::P6ERR initialize(const P6R::P6DLLAPI *pDllApi, const P6R::P6WCHAR *pwszFilename)=0
This method initializes the module for use and must be called prior to calling any other method (with...
const P6R::CATID * m_pCATID
Definition: p6compif.h:38
virtual P6R::P6ERR reset()=0
Resets the enumeration to the begining.
virtual P6R::P6ERR enumComponents(P6R::p6IEnumComponents **ppEnum)=0
User to enumerate the available components in the module return each components associated P6COMPONEN...
virtual P6R::P6ERR next(P6R::P6UINT32 cElements, P6R::P6COMPONENTDATA *parElements, P6R::P6UINT32 *pcReturned)=0
This method is used to iterate the module components.
P6R::P6UINT32 m_cCatEntCount
The number of valid category entries in the m_parCategories array.
Definition: p6compif.h:68
P6R::P6VOID(* CIDCB)(const P6R::CID &cid, P6R::P6VOID *pCtx)
Definition: p6compif.h:74
wchar_t P6WCHAR
Wide character type see p6i18n.h.
Definition: p6types.h:76
virtual P6R::P6ERR getVersionString(P6R::VERSTRFIELDS nField, P6R::P6WCHAR *pBuffer, P6R::P6SIZE *pcBuffer)=0
This method is used to retrieve the modules VERINFO string data.
virtual P6R::P6ERR end()=0
Called by the component loader to execute any shutdown code that the component DLL needs to execute b...
int P6INT32
Definition: p6types.h:41
virtual P6R::P6ERR selfRegister(P6R::p6IRegistrar *pRegistrar)=0
This method is called to have the module register itself with the COM runtime.
The base interface all [p6]COM components must derive from and implement.
Definition: p6comdef.h:96
P6R::P6ERR(* P6CREATEINST)(P6R::p6ICom *pOuter, const P6R::IID &iid, P6R::P6VOID **ppNewComponent)
Defines the static createInstance() method that a component must implement (usually using the P6_DECL...
Definition: p6compif.h:50
P6COM DLL runtime api definitions.
A universally unique indentifier (UUID).
Definition: p6types.h:131
virtual P6R::P6ERR getVersion(P6R::VERFIELDS nField, P6R::P6VERSION *pVersion)=0
This method is used to retrieve the module's version information.
P6UINT32 P6ERR
COM err return type see P6ERR.h.
Definition: p6types.h:109
virtual P6R::P6ERR unregisterComponent(const P6R::CID &cid)=0
Enumerates the components in the current module (DLL).
Definition: p6compif.h:106
#define P6COMMETHOD
Definition: p6types.h:872
virtual P6R::P6ERR registerComponent(const P6R::CID &cid, const P6R::P6WCHAR *pszName, const P6R::P6WCHAR *pszPathname)=0
Component module interface used to interface with the COM runtime.
Definition: p6compif.h:155
virtual P6R::P6ERR canUnloadNow()=0
Determines if the module could be unloaded.
P6R::P6CREATEINST m_pfnCreateInstance
Method used by the component factory to create an uninitialize instance of it.
Definition: p6compif.h:65
const P6R::P6CATEGORYDATA * m_parCategories
NULL terminated array of categories that this component wants to register under.
Definition: p6compif.h:67
const P6R::P6WCHAR * m_pszComponentName
Freindly name of component.
Definition: p6compif.h:66
void P6VOID
Definition: p6types.h:75
virtual P6R::P6ERR registerAll()=0
An array of these is used to define categories that a component is a member of.
Definition: p6compif.h:36
virtual P6R::P6ERR selfUnregister(P6R::p6IRegistrar *pRegistrar)=0
This methods is used to tell the module to unregister all of it's components from the COM runtime...
char P6CHAR
Narrow character type.
Definition: p6types.h:71
Manages component data for the [p6]COM component glue.
Definition: p6compif.h:62