Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error creating ActiveX control

Status
Not open for further replies.

imperialx

IS-IT--Management
Jul 21, 2009
2
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top