hello,
i am working on the COM base logger (inproc server).
i want to load the COM DLL by various exes (com clients )and then call its logging API.
i want to do all logging into same file.
for this i have COM object which would return me the Logger interface.
inside the COM logger i am returning the same COM objects. if it is already created by
Result = CComObject<Logger>::CreateInstance( &g_pLogger );
i am guarding it with a static member variable like binitialized.
but static and global variables are mapped different for each process.
how should i model it so that i could use the same COM interface to write into same file
Code:if ( !m_bInitialized ) { Result = CComObject<Logger>::CreateInstance( &g_pLogger ); if ( SUCCEEDED( Result ) ) { g_Logger->AddRef(); m_bInitialized = true; } else { g_pLogger = NULL; return E_UNEXPECTED; } }
regards
Deepak




Reply With Quote