2

I have a C# COM object with two public methods.

  1. SendMessage()
  2. SendMessage(int priority)

I am trying to call these methods from a VB6 project, but intellisense shows only the method without the priority. If I try entering a priority anyway I get a compile error, "Wrong number of arguments or invalid property assignment".

Am I just doing something wrong, or do I need to change the C# dll?

3
  • 1
    There's no overloading in VB6 so you can't have multiple functions with the same name. Commented Dec 30, 2017 at 0:18
  • 2
    @MethodMan what more does this question need? It seems clear, to the point, and an issue the querent was having. Commented Jan 2, 2018 at 21:20
  • I also don't see why it was closed. The question is perfectly clearly formulated. There are no "debugging details" required. Commented Feb 22, 2022 at 3:53

1 Answer 1

5

or do I need to change the C# dll

If you can, then that would be for the better, as COM does not support overloading, so it is best avoided with COM-visible interfaces.

There should be a method in the COM interface that is something like SendMessage_2(int priority) bound to your SendMessage(int priority) though.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.