Trying to write a COM accessible DLL

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top