Trying to write a COM accessible DLL

  • Thread starter Thread starter Terry Olsen
  • Start date Start date
T

Terry Olsen

Following the instructions here:
http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=113

The following is my ClassLibrary code:

Imports System

Namespace Test

Public Class Test2

Public Sub Test3()
End Sub

Private outMxRecords As String()

Public ReadOnly Property MxRecords() As String()
Get
Return outMxRecords
End Get
End Property

Public Sub GetMxRecords(ByVal Domain As String)
outMxRecords = "test1.test2".Split(".")
End Sub

End Class

End Namespace

I build the DLL, copy it to the C:\WINNT\System32 directory, then run
REGASM on it, it tells me "Types Registered Successfully"

The following is my VBScript code:

dim oDLL
set oDLL = Createobject("Test.Test2")
if err.number<>0 then
msgbox "ERROR " & err.number & " opening DLL"
else
msgbox "Success"
end if

When I run the script, I get the following error:

ActiveX component can't create object: 'Test.Test2'

Error code is 800A01AD

I can't see anything wrong with this. Hopefully someone here can help me
out.
 
Back
Top