Hi, I'm trying to create my first sample ActiveX control but I get this error "AClass.vb(1,1): error CS0116: A namespace does not directly contain members such as fields or methods".
I created a class "AClass.vb" then copy it under the folder "\WINDOWS\Microsoft.NET\Framework\v2.0.50727", then run this command under DOS prompt: "csc /t:library AClass.VB"
AClass.vb
Imports System
Imports System.Runtime.InteropServices
Namespace ANamespace
<ClassInterface(ClassInterfaceType.AutoDual)> _
Public Class AClass
Implements ASignatures
Public Function FName() As String Implements ASignatures.FName
Return "John"
End Function
Public Function SName() As String Implements ASignatures.SName
Return "Imperialx"
End Function
Public ReadOnly Property Age() As Integer Implements ASignatures.Age
Get
Return 24
End Get
End Property
End Class
Public Interface ASignatures
Function FName() As String
Function SName() As String
ReadOnly Property Age() As Integer
End Interface
End Namespace
cheers,
imperialx
I created a class "AClass.vb" then copy it under the folder "\WINDOWS\Microsoft.NET\Framework\v2.0.50727", then run this command under DOS prompt: "csc /t:library AClass.VB"
AClass.vb
Imports System
Imports System.Runtime.InteropServices
Namespace ANamespace
<ClassInterface(ClassInterfaceType.AutoDual)> _
Public Class AClass
Implements ASignatures
Public Function FName() As String Implements ASignatures.FName
Return "John"
End Function
Public Function SName() As String Implements ASignatures.SName
Return "Imperialx"
End Function
Public ReadOnly Property Age() As Integer Implements ASignatures.Age
Get
Return 24
End Get
End Property
End Class
Public Interface ASignatures
Function FName() As String
Function SName() As String
ReadOnly Property Age() As Integer
End Interface
End Namespace
cheers,
imperialx