00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 #ifndef COMSTL_INCL_H_COMSTL
00060 # include "comstl.h"
00061 #endif
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080 #ifndef _COMSTL_NO_NAMESPACE
00081 # if defined(_STLSOFT_NO_NAMESPACE) || \
00082 defined(__STLSOFT_DOCUMENTATION_SKIP_SECTION)
00083
00084 namespace comstl
00085 {
00086 # else
00087
00088
00089 namespace stlsoft
00090 {
00091
00092 namespace comstl_project
00093 {
00094
00095 # endif
00096 #endif
00097
00098
00099
00104
00105
00106
00107
00108
00118 inline HRESULT Rot_Register(DWORD grfFlags,
00119 LPUNKNOWN punkObject,
00120 LPMONIKER pmkObjectName,
00121 DWORD *pdwRegister)
00122 {
00123 LPRUNNINGOBJECTTABLE prot;
00124 HRESULT hr = ::GetRunningObjectTable(0, &prot);
00125
00126 if(SUCCEEDED(hr))
00127 {
00128 hr = prot->Register(grfFlags, punkObject, pmkObjectName, pdwRegister);
00129
00130 prot->Release();
00131 }
00132
00133 return hr;
00134 }
00135
00143 inline HRESULT Rot_Revoke(DWORD dwRegister)
00144 {
00145 LPRUNNINGOBJECTTABLE prot;
00146 HRESULT hr = ::GetRunningObjectTable(0, &prot);
00147
00148 if(SUCCEEDED(hr))
00149 {
00150 hr = prot->Revoke(dwRegister);
00151
00152 prot->Release();
00153 }
00154
00155 return hr;
00156 }
00157
00166 inline HRESULT Rot_IsRunning(LPMONIKER pmkObjectName)
00167 {
00168 LPRUNNINGOBJECTTABLE prot;
00169 HRESULT hr = ::GetRunningObjectTable(0, &prot);
00170
00171 if(SUCCEEDED(hr))
00172 {
00173 hr = prot->IsRunning(pmkObjectName);
00174
00175 prot->Release();
00176 }
00177
00178 return hr;
00179 }
00180
00191 inline HRESULT Rot_GetObject( LPMONIKER pmkObjectName,
00192 LPUNKNOWN *ppunkObject)
00193 {
00194 LPRUNNINGOBJECTTABLE prot;
00195 HRESULT hr = ::GetRunningObjectTable(0, &prot);
00196
00197 if(SUCCEEDED(hr))
00198 {
00199 hr = prot->GetObject(pmkObjectName, ppunkObject);
00200
00201 prot->Release();
00202 }
00203
00204 return hr;
00205 }
00206
00216 inline HRESULT Rot_NoteChangeTime( DWORD dwRegister,
00217 FILETIME *lpfiletime)
00218 {
00219 LPRUNNINGOBJECTTABLE prot;
00220 HRESULT hr = ::GetRunningObjectTable(0, &prot);
00221
00222 if(SUCCEEDED(hr))
00223 {
00224 hr = prot->NoteChangeTime(dwRegister, lpfiletime);
00225
00226 prot->Release();
00227 }
00228
00229 return hr;
00230 }
00231
00241 inline HRESULT Rot_GetTimeOfLastChange( LPMONIKER pmkObjectName,
00242 FILETIME *lpfiletime)
00243 {
00244 LPRUNNINGOBJECTTABLE prot;
00245 HRESULT hr = ::GetRunningObjectTable(0, &prot);
00246
00247 if(SUCCEEDED(hr))
00248 {
00249 hr = prot->GetTimeOfLastChange(pmkObjectName, lpfiletime);
00250
00251 prot->Release();
00252 }
00253
00254 return hr;
00255 }
00256
00264 inline HRESULT Rot_EnumRunning(IEnumMoniker **ppenumMoniker)
00265 {
00266 LPRUNNINGOBJECTTABLE prot;
00267 HRESULT hr = ::GetRunningObjectTable(0, &prot);
00268
00269 if(SUCCEEDED(hr))
00270 {
00271 hr = prot->EnumRunning(ppenumMoniker);
00272
00273 prot->Release();
00274 }
00275
00276 return hr;
00277 }
00278
00280
00282
00283
00284 #ifdef STLSOFT_UNITTEST
00285
00286 namespace unittest
00287 {
00288 ss_bool_t test_comstl_rot_functions(unittest_reporter *r)
00289 {
00290 using stlsoft::unittest::unittest_initialiser;
00291
00292 ss_bool_t bSuccess = true;
00293
00294 unittest_initialiser init(r, "COMSTL", "rot_functions", __FILE__);
00295
00296 #if 0
00297 if(<<TODO>>)
00298 {
00299 r->report("<<TODO>> failed ", __LINE__);
00300 bSuccess = false;
00301 }
00302 #endif
00303
00304 return bSuccess;
00305 }
00306
00307 unittest_registrar unittest_comstl_rot_functions(test_comstl_rot_functions);
00308
00309 }
00310
00311 #endif
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323 #endif
00324
00325
00326
00327
00328
00329