Re: 2+2=4, but only once !?
- From: Craig Powers <enigma@xxxxxxxxxx>
- Date: Mon, 07 Aug 2006 12:18:33 -0400
Richard Maine wrote:
Unless.... I might (or might nit) recall some funniness about how initialization is handled in DLLs.
It's not "funny" if you think of DLLs as being code that is a part of your program -- then, the initialization on first call only makes sense. In fact, this is exactly the case and why they behave the way they do.
However, if you make the mistake of thinking of DLLs as being a separate entity that functions like a program, then you might indeed be surprised to find that variables are only initialized on first call and subsequently (if SAVEd or treated as though they are SAVEd) retain their last assigned value.
This is, obviously, a big potential issue with porting code designed to run as a standalone program into a callable DLL function. But that's not really specific to DLLs, as it would be equally an issue if the main program were modified to support calling the code multiple times in response to user input.
.
- References:
- 2+2=4, but only once !?
- From: Walter
- Re: 2+2=4, but only once !?
- From: Ancient_Hacker
- Re: 2+2=4, but only once !?
- From: Walter
- Re: 2+2=4, but only once !?
- From: Steve Lionel
- Re: 2+2=4, but only once !?
- From: Richard Maine
- 2+2=4, but only once !?
- Prev by Date: Re: backspace error (reading file from the end)
- Next by Date: Re: backspace error (reading file from the end)
- Previous by thread: Re: 2+2=4, but only once !?
- Next by thread: Re: 2+2=4, but only once !?
- Index(es):
Relevant Pages
|