Not sure how detailed or "basic" help you need but let's start with this.
1) Create a VB.NET project and add a class in it.
Public Class Class1
Public Sub New()
' Initialize class
End Sub
' Add properties
' Add methods
End Class
I created a project ClassLibrary1 with Class1. Then compile it, you should now have ClassLibrary1.dll
2) Register assembly:
regasm /tlb classlibrary1.dll If you get "... is not a valid .NET assembly" error, you're using wrong version of regasm. Fully qualify it:
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\regasm /tlb classlibrary1.dll"
3) Open regedt32 and search from HKCR your classlibrary1 (press CTRL+F to use Find). You should find it from a place similar to HKCR\TypeLib\{9529A0DE-7DCC-4587-B9B0-3C702F33AF6E}. {9529A0DE-7DCC-4587-B9B0-3C702F33AF6E} is now the ClassID you will use.
4) Check MSDN for the documentation of
sp_oacreate. In my case the syntax would be:
sp_OACreate '{9529A0DE-7DCC-4587-B9B0-3C702F33AF6E}' , myToken OUTPUT , 1 and now the integer variable myToken would be the object token to ClassLibrary1.Class1
Hope this helps.
Anyway, a few points if something goes wrong: change from the Class1 "COM Class = True" from the attributes. Now the registration (phase 2) changes to: regsvr32 classlibrary1.dll.