Hi Eric,
I suggest maintaining a global Category pointer rather than a global
Category reference. The pointer can then be initialized within
DllMain. As for the "exception or poor memory reference", please post
details so I can offer suggestions.
-Aaron
--- "Eric Brown (Propel)" <eb...@pr...> wrote:
> I'm trying to use log4cpp inside a dll. I don't want to use global
> initializers like:
> Category& logger = Category::getInstance("bla");
> because it gets invoked before my dllmain. Furthermore, it seems to
> be causing some kind of exception or poor memory reference or
> something that I can't detect in my context. (I'm not sure what the
> stupid Windows loader is doing, but it is doing something annoying.)
> If I call getInstance() in a function, I have to call it in every
> function as I can't figure out how to assign a category to a global
> variable after my dllmain is called because Category::operator= is
> declared as private and not implemented as far as I can tell.
>
> I'm really stuck here. Otherwise, my tests of log4cpp seem to
> indicate that other than the code size it adds to my dll, it is
> great.
>
> Thanks,
> Eric
>
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
|