473,320 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Trying to write a COM accessible DLL

Following the instructions here:
http://www.csharpfriends.com/Article...?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.

*** Sent via Developersdex http://www.developersdex.com ***
Dec 12 '06 #1
1 895
well i see already one thingy you missed

A com creatable class must have a parameterless public sub new

here is an example i once showed in this newsgroup :

http://groups.google.com/group/micro...996d74d250974e

"csharpfriends" you could have known this wouldn`t work in VB ;-)
regards

Michel Posseth [MCP]
"Terry Olsen" wrote:
Following the instructions here:
http://www.csharpfriends.com/Article...?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.

*** Sent via Developersdex http://www.developersdex.com ***
Dec 12 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Eli | last post by:
I've got a script that I'm trying to debug which uses document.write() to place HTML within a page. In both IE6 and Firefox when I view source, I see only the script itself and not any HTML as...
1
by: Miha | last post by:
Hi. I want to write some text ("bla bla") to a file something.txt. That file is accessible on http://192.168.0.1/dir/something.txt (I'm on LAN side). I can read from that file. Web server is on...
2
by: Angie | last post by:
Hi, all, I’m newbie in .net, does any expert help me on the following questions? Thanks I have a DLL file wrote in Visual C++ 6.0 for sending message from one server to the other server, and...
2
by: =?Utf-8?B?RGFtZW9u?= | last post by:
Hi - I am attempting to write lines to a file at high volume, multiple threads. Here is my scenario: (initial "WriteToFile" object created via a parent multithreaded process, which receives...
20
by: _mario.lat | last post by:
hallo, I use PHP and I'd like to not write in hardcoded way password and login to access to mysql. how to not write password in code for access to mysql? How can I do? I'd like that who see my...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.