When does DLL terminate code get called? 
Author Message
 When does DLL terminate code get called?

In the VB IDE, when does the terminate / cleanup code in the DLL get called?
Is it:

1. When the application stops?

or

2. When the IDE exits?

We've got random crashes on exiting the IDE which appears to be somehow
related to a 3rd party DLL we're using. The problem doesn't appear to occur
with the compiled version but it's worrying.

Thanks, Rob.



Fri, 27 Jun 2003 22:08:49 GMT  
 When does DLL terminate code get called?
Well, I ran a simple test by F8'ing thru this form code:

Option Explicit
Private c As Class1
Private Sub Form_Load()
 Set c = New Class1            '-----this runs the Class Initialize code
 Unload Me
End Sub

Private Sub Form_Unload(Cancel As Integer)
 Set c = Nothing                '-----this runs the Class Terminate code
End Sub

and this class code
Option Explicit

Private Sub Class_Initialize()
 MsgBox "Init Class1"
End Sub

Private Sub Class_Terminate()
 MsgBox "Term Class1"
End Sub

HTH


Quote:
> In the VB IDE, when does the terminate / cleanup code in the DLL get
called?
> Is it:

> 1. When the application stops?

> or

> 2. When the IDE exits?

> We've got random crashes on exiting the IDE which appears to be somehow
> related to a 3rd party DLL we're using. The problem doesn't appear to
occur
> with the compiled version but it's worrying.

> Thanks, Rob.



Fri, 27 Jun 2003 23:45:01 GMT  
 When does DLL terminate code get called?
It happens often during saving the last changes made.

You don't have to worrie, it's VB related, VB does not unload the (standard)
DLL.
I had the same problem and internally is made use of the instance of the DLL
instead of the application instance to build controls etc..
This works slightly better, VB is not unloaded in design mode (of course)
But it's very annoying!

Quote:

>In the VB IDE, when does the terminate / cleanup code in the DLL get
called?
>Is it:

>1. When the application stops?

>or

>2. When the IDE exits?

>We've got random crashes on exiting the IDE which appears to be somehow
>related to a 3rd party DLL we're using. The problem doesn't appear to occur
>with the compiled version but it's worrying.

>Thanks, Rob.



Sat, 28 Jun 2003 01:35:50 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Help calling DLL with Null terminated strings

2. Calling external DLL gets error 48, unable to load DLL

3. BAD DLL calling conventions - What am I doing wrong

4. MSC-DLL Call by p-code exe and by native code exe (VB5)

5. VBScript terminates before MS Agent is done speaking

6. calling dll func, getting wrong result...

7. Q: Getting Memory shared violation when calling a dll from VB.

8. Getting Bad DLL calling convention on VB 4.0

9. Q: Getting calling process from in-process server dll

10. Q: Getting calling process from in-process server dll

11. Q: Getting calling process from in-process server dll

12. 2 PRBS: Calling 16 bit DLL from VB5 and Bad DLL Calling Convention

 

 
Powered by phpBB® Forum Software