Discussion:
the initialization of the main program and its loading DLL
(too old to reply)
blackbiscuit
2008-11-12 06:28:46 UTC
Permalink
Dear All,

Now in my current developing project, I have defined a global object
in the main program . In dlls, there are also some static object whose
constructor will use the global object in the main program. But the
problem is always the initialization of the dll is prior to the main
program. How can I do if I wanna the main program be initialized
first?

Thank you very much!

Best,
Tony
r***@pen_fact.com
2008-11-12 15:14:16 UTC
Permalink
On Tue, 11 Nov 2008 22:28:46 -0800 (PST), blackbiscuit
Post by blackbiscuit
Dear All,
Now in my current developing project, I have defined a global object
in the main program . In dlls, there are also some static object whose
constructor will use the global object in the main program. But the
problem is always the initialization of the dll is prior to the main
program. How can I do if I wanna the main program be initialized
first?
I hope someone will come up with an easier answer, but loading the DLL
dynamically (using LoadLibrary and GetProcAddress) will certainly let
you control when it is loaded, and thus initialized.
Post by blackbiscuit
Thank you very much!
Best,
Tony
-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 400
Boston, MA 02116
www.penfact.com
Useful reading (be sure to read its disclaimer first):
http://catb.org/~esr/faqs/smart-questions.html
blackbiscuit
2008-11-19 02:56:04 UTC
Permalink
Hi,

I think you just repeat what I have said.
Post by r***@pen_fact.com
On Tue, 11 Nov 2008 22:28:46 -0800 (PST), blackbiscuit
Post by blackbiscuit
Dear All,
Now in my current developing project, I have defined a global object
in the main program . In dlls, there are also some static object whose
constructor will use the global object in the main program. But the
problem is always the initialization of the dll is prior to the main
program. How can I do if I wanna the main program be initialized
first?
I hope someone will come up with an easier answer, but loading the DLL
dynamically (using LoadLibrary and GetProcAddress) will certainly let
you control when it is loaded, and thus initialized.
Post by blackbiscuit
Thank you very much!
Best,
Tony
-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).
Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 400
Boston, MA 02116www.penfact.com
http://catb.org/~esr/faqs/smart-questions.html
r***@pen_fact.com
2008-11-19 18:00:11 UTC
Permalink
On Tue, 18 Nov 2008 18:56:04 -0800 (PST), blackbiscuit
Post by blackbiscuit
Hi,
I think you just repeat what I have said.
I don't see anything in your original post about LoadLibrary, so I
don't see how I repeated anything you said.

I do think that if you want help, you will need to provide a clearer
description. In particular, how are the dlls loaded (how do you invoke
them)? Are they used in the main program? Are they used in other
programs?
Post by blackbiscuit
Post by r***@pen_fact.com
On Tue, 11 Nov 2008 22:28:46 -0800 (PST), blackbiscuit
Post by blackbiscuit
Dear All,
Now in my current developing project, I have defined a global object
in the main program . In dlls, there are also some static object whose
constructor will use the global object in the main program. But the
problem is always the initialization of the dll is prior to the main
program. How can I do if I wanna the main program be initialized
first?
I hope someone will come up with an easier answer, but loading the DLL
dynamically (using LoadLibrary and GetProcAddress) will certainly let
you control when it is loaded, and thus initialized.
Post by blackbiscuit
Thank you very much!
Best,
Tony
-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).
Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 400
Boston, MA 02116www.penfact.com
http://catb.org/~esr/faqs/smart-questions.html
-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 400
Boston, MA 02116
www.penfact.com
Useful reading (be sure to read its disclaimer first):
http://catb.org/~esr/faqs/smart-questions.html

Loading...