I have collected a bunch of functions into a dll.
On module level I have declaration for the dll:
Private WithEvents curInstance As fnDll.
The dll is called in a loop as follows (simplified)
and what would be desired is that the previous instance
would totally be released from memory prior creating
a new one.
for i = 0 to N
While blcurInstanceProcessing
DoEvents
Wend
Set curInstance = Nothing
Set curInstance = New fnDll
curInstance.fn1
curInstance.fn2
etc...
next i
Set curInstance = Nothing
The last event of curInstance triggers
an event that sets blcurInstanceProcessing false
and only after that a new instance should be created.
Everything is working fine except that the stack
gets overloaded as the N may be like 100 or more.
I have a debug msgbox in the class terminate of
curInstance. From this I can see that all the instances
are piled and not realesed before the loop is completed
after which all the instances are released one after the
other (from last to first as expected). How can I get the
releasing to occure instantly when curInstance is set
to Nothing?
With other things I have now a function in the dll
that ensures all it's object are released - that didn't help,
neither does doevents or any other tricks that I have
tried.
thanks
johannes
ft - 17 Dec 2003 15:25 GMT
Try bright and early in the morning.
> Microsoft Knowledge Base Article - 241896
> Microsoft Knowledge Base Article - 264957
johannes
> I have collected a bunch of functions into a dll.
> On module level I have declaration for the dll:
[quoted text clipped - 43 lines]
>
> johannes