简体   繁体   中英

Converting C# to vb.net error

I have converted ac# 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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM