I created an Active X DLL a few months ago in VB and it worked fine. Recently a crash left me without my VB files, but I had my code pasted from an e-mail. I have been trying to recreate the files but I don't know what I'm missing. The code should work because it's direct from the last version. I just don't know what I'm doing wrong.
In my DLL I have the project named ACAS400DLL. My class module inside is named GetLoanNum and the code in that class module is:
Then I try to instantiate this from a VB EXE which I call testdll. I have included a reference to the acas400.dll file. My code for that is:
If I make the reference to the old DLL file (which I have compiled but lost the code for) the testdll.exe works fine, but if I use the newly created DLL code I get an error on the line
that error is: Run Time Error 429: ActiveX component can't create object
I have been working on this checking and double checking every setting in my DLL, since the problem must be in the DLL, not the testdll.exe, but I can't make it work.
Please, I'm begging, help???
In my DLL I have the project named ACAS400DLL. My class module inside is named GetLoanNum and the code in that class module is:
Code:
Public Num As String
Public Function GetLoanNum() As String
On Error GoTo GetDllErr
{Processing code removed}
GetLoanNum = "123456789"
Exit Function
GetDllErr:
MsgBox Error(Err)
Exit Function
End Function
Private Function isAllNums(testString As String) As Boolean
Dim x As Integer
isAllNums = False
For x = 1 To Len(testString)
Select Case Mid(testString, x, 1)
Case "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"
isAllNums = True
Case Else
isAllNums = False
End Select
Next x
End Function
Then I try to instantiate this from a VB EXE which I call testdll. I have included a reference to the acas400.dll file. My code for that is:
Code:
Private o As acas400.GetLoanNum
Private Sub Command1_Click()
Set o = New GetLoanNum
Dim str As String
str = o.GetLoanNum() 'return value from function
MsgBox str
End Sub
If I make the reference to the old DLL file (which I have compiled but lost the code for) the testdll.exe works fine, but if I use the newly created DLL code I get an error on the line
Code:
Set o = new GetLoanNum
I have been working on this checking and double checking every setting in my DLL, since the problem must be in the DLL, not the testdll.exe, but I can't make it work.
Please, I'm begging, help???