Hi,
Wanted to use an ActiveX dll in my program so I created following test projects:
- DLL_test.exe
- ActiveX_DLL.dll
(I did set binary compability to the DLL).
Run the compiled DLL_test.exe and click a button and sure enough I get the message box
The problem is that once the button was clicked at least once, I can't replace the DLL with a new one. Looks like my EXE program is not releasing the DLL once it is called. After closing my EXE and even restarting I can replace the DLL no problem (until I use the function by clicking the button again).
Code:
' Function in my ActiveX_DLL.dll
Public Function About()
MsgBox "My DLL v2.5"
End Function
' My DLL_Test.exe program
Private Sub cmdActiveXDLL_Click()
Dim myDLL As Object
Set myDLL = CreateObject("ActiveX_DLL.class1")
myDLL.About
Set myDLL = Nothing
End Sub
I thought the the code below should be releasing the DLL, but it's not.
Code:
Set myDLL = Nothing
Any ideas?