CodeSite in a DLL & multiple CodeSiteManager instances

Post questions here regarding the CodeSite Express edition

CodeSite in a DLL & multiple CodeSiteManager instances

Postby JonRobertson » Mon Oct 07, 2013 6:53 pm

I've started using CodeSite in DLLs. I also use CodeSite in the application that loads the DLL. So there are two instances of CodeSiteManager in the current process. (That's if I only load one DLL. We actually have multiple DLLs loaded.)

I have a shared unit that maintains my own global CodeSite instance. The first time it is called, CodeSiteManager is configured and my global instance is created. I'm currently able to do CodeSite logging very early in the application/service startup process or very late in the shutdown process. (And very early in the DLL load process, while LoadLdrDLL is still loading the DLL.) Each CodeSite log file is named using a combination of the EXE name and the timestamp of log creation. The side effect is that I'm getting a separate log file each time a DLL is loaded.

Is there a way that the DLL project can detect whether the EXE contains a CodeSiteManager instance and, if so, access the properties of that instance? We're not using packages, so I can't use something like FindComponent. :( My usage in a DLL should also be able to "know" when the EXE does not have a CodeSiteManager. It would then configure its own properties rather than copying the EXE's properties.

I know I could have a mechanism where I pass the EXE's CodeSiteManager to the DLL once it is loaded. However, this has a few disadvantages. For one, I might have CodeSite calls inside initialization sections, and those would execute before the DLL's CodeSiteManager could be configured.

Thanks!
JonRobertson
 
Posts: 28
Joined:
Thu Sep 15, 2011 12:08 am

Re: CodeSite in a DLL & multiple CodeSiteManager instances

Postby JonRobertson » Mon Oct 07, 2013 9:18 pm

I think I can achieve what I'm after using a named file mapping object. I'll report back whether I get it working.
JonRobertson
 
Posts: 28
Joined:
Thu Sep 15, 2011 12:08 am

Re: CodeSite in a DLL & multiple CodeSiteManager instances

Postby JonRobertson » Tue Oct 08, 2013 11:53 am

Fyi, got it working last night.
JonRobertson
 
Posts: 28
Joined:
Thu Sep 15, 2011 12:08 am


Return to Express Edition

Who is online

Users browsing this forum: No registered users and 3 guests

cron