samedi 14 juillet 2012 20:07
I have been converting a large program from VB6 to VS 2010 and ran into this warning:
Warning 1 The designer must create an instance of type 'Microsoft.VisualBasic.Compatibility.VB6.BaseControlArray' but it cannot because the type is declared as abstract. 0 0
It does not let me see what segment of the program is causing this. What is it telling me and what do i do to solve it.
Toutes les réponses
samedi 14 juillet 2012 21:26
For an explanation have a look at the first contribution in the "Community content" section here: http://msdn.microsoft.com/en-us/library/2xh82hxd.aspx
As control arrays are not required anymore the way it was in VB6, there are new classes created during the upgrade that emulate the behavior. For example, the class LabelControlArray. It's base class is the BaseControlArray class metioned in the error message.
Possibly you have an array of MSWinsock "controls" in the VB6 project? These are no real controls (visible on the Form at runtime), hence the problem. I do not have a solution other than changing either the VB6 code so that it does not make use of an array for MSCom, i.e. use seperate names without an index, or manually change the upgraded project afterwards. The same problem (unsolved) is mentioned here: http://social.msdn.microsoft.com/Forums/pl/Vsexpressvb/thread/b6fcf011-6a74-40f7-bd50-016ded44d8ba
EDIT: There is no MSComArray class, so you must change it manually: