Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / ActiveX Controls / December 2003

Tip: Looking for answers? Try searching our database.

DLL and stack problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ft - 15 Dec 2003 12:56 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.