Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 647875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:46:16+00:00 2026-05-13T21:46:16+00:00

Question: I’m trying out to convert this here: http://support.microsoft.com/kb/828736 to VB.net I got it

  • 0

Question: I’m trying out to convert this here:
http://support.microsoft.com/kb/828736
to VB.net

I got it to work in C#, and it should work without problems in VB.net, the only problem is the managed class won’t compile, i get this error:
Error Class “ManagedClass” has to implement “Function Add(Number1 As Integer, Number2 As Integer) As Integer” for the ICalculator-Interface

Why? I see one function declared, and one implemented, and that with the same arguments… What’s wrong ?

 Imports System
 Imports System.Collections.Generic
 Imports System.Text

Namespace TestLibrary2
' Interface declaration.
Public Interface ICalculator
    Function Add(ByVal Number1 As Integer, ByVal Number2 As Integer) As Integer
End Interface



' Interface implementation.
Public Class ManagedClass
    Implements ICalculator
    Public Function Add(ByVal Number1 As Integer, ByVal Number2 As Integer) As Integer
        Return Number1 + Number2
    End Function
End Class


End Namespace
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T21:46:16+00:00Added an answer on May 13, 2026 at 9:46 pm

    In VB.Net, you have to be explicit about your interface implementation – this allows more flexibility than C# (because you can name your functions whatever you like), but is a little more work.

    Public Function Add(ByVal Number1 As Integer, ByVal Number2 As Integer) As Integer Implements ICalculator.Add
        Return Number1 + Number2
    End Function
    

    As both M.A. Hanin and myself have mentioned – it lets you pick the names, but neither of us mentioned yet why you might want to do this. One example would be if you’re implementing two interfaces that both define the same method name. And you want to expose both of these methods as public methods on your class. In C#, you’d have to create at least one “wrapper” function that calls another to achieve this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Question: Have I got this example backwards? Is the reason to return Interface so
QUESTION: What am I missing or doing wrong? I'm trying to migrate fully functional
Question is already been asked in title. Here is a code: (function($){ var filter
Question is relevant to this and this ; the difference is, I'd prefer something
Question: Can I override default functions in Javascript? Background: After figuring out that I
Question : Is there a simple way to print out an array in Ruby
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Question: Considering the hello-gl2 example from Android NDK r6b, is this example correct when
Question for the etymology wizards out there: which programming language was the first to
I know there's a lot of other questions out there that deal with this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.