1

I have converted a c# program to vb.net with a tool The program works fine in c#

in vb I get this error

Public member 'get_SymbolList' on type 'ConnectionControlClass' not found."}

at this line

oList = axTradeIdeasWindowX1.Connection.get_SymbolList(CType(i,Integer))

IN C#

This line works fine

oList = axTradeIdeasWindowX1.Connection.get_SymbolList(CType(i,Integer))

any ideas what the problem could be. I have checked each and every line in the program list walked through the Objects could not find get_SymbolList only found SymbolList wonder if get_ is a C# construct and if there is a vb.net equivalent

1
  • 4
    ..without seeing the Connection class it is impossible to say.. however it's probably because the converter has changed a property to a method. Commented Jan 12, 2013 at 10:51

1 Answer 1

7

Clearly axTradeIdeasWindowX1 is an ActiveX object. The C# code had to use the get_ prefix on the SymbolList property because the C# language doesn't support indexed properties. This is not a problem in COM nor in VB.NET. Accordingly, the VB.NET compiler didn't turn the property in a method when it imported the interop library, like the C# compiler did. There is no get_SymbolList() method anymore, only a SymbolList property. You can see this by looking at the interop library with Object Browser.

So simply fix your problem by omitting the get_ prefix.

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.