|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Trying to write a COM accessible DLLhttp://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. *** Sent via Developersdex http://www.developersdex.com *** 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/microsoft.public.dotnet.languages.vb/browse_thread/thread/b9974554b8d68a52/ca996d74d250974e?lnk=st&q=michel+posseth+COM+VB.Net&rnum=28#ca996d74d250974e "csharpfriends" you could have known this wouldn`t work in VB ;-) regards Michel Posseth [MCP] Show quoteHide quote "Terry Olsen" wrote: > 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. > > *** Sent via Developersdex http://www.developersdex.com *** >
Multi-User Data App Architecture
How to use one datagrid to update/insert into another Migrating to VS 2005 11th hour failure to trigger click event for object in hash table Bring in a form from another solution/project timer1.stop Re: destroying/releasing objects from memory? convert BASIC to VB.NET How to Insert field and value into another grid C++ DLL Usage (p/invoke?) |
|||||||||||||||||||||||