Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Well i get a error , and do'nt know what it is and there is nothing on google:

here is the code:

Imports System
Imports System.Runtime.InteropServices
Namespace CM2
   'Since the .NET Framework interface and coclass have to behave as 
   'COM objects, we have to give them guids.
   <Guid("")> Public Interface IManagedInterface
       Function PrintHi(ByVal Name As String) As Integer
   End Interface

   <Guid("")> Public Class InterfaceImplementation
       Implements IManagedInterface
       Public Function PrintHi(ByVal name As String) As Integer
           Console.WriteLine("Hello, {0}!", name)
           Return 33
       End Function
   End Class
End Namespace

the error is on:

Implements IManagedInterface

and the error msg is:

COM.vb(15) : error BC30149: 'CM2.InterfaceImplementation' must implement 'Function PrintHi(Name As String) As Integer' for interface 'CM2.IManagedInterface'.

 

any one had something like this befor?

  • Administrators
Posted
 Public Interface IManagedInterface
	Function PrintHi(ByVal Name As String) As Integer
End Interface

 Public Class InterfaceImplementation
	Implements IManagedInterface

	Public Function PrintHi(ByVal name As String) As Integer Implements IManagedInterface.PrintHi
		Console.WriteLine("Hello, {0}!", name)
		Return 33
	End Function

End Class

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...