Re: Interesting VS 2003 designer behavior

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Jeffrey Tan[MSFT] (v-jetan_at_online.microsoft.com)
Date: 12/07/04


Date: Tue, 07 Dec 2004 02:44:48 GMT

Hi LF,

Thanks very much for your feedback!!

Yes, I see that your collection item class has 2 overloading constructor
one requires string parameter, another requires int parameter.

But the collection class's AddRange is to add the class item array into the
collection, not the class item's constructor parameter array, we should
only provide "AddRange(Data [] data)" for the collection class, because the
item in the collection is of type "Data".

In the AddRange method, currently for VS.net 2003, it does not know of the
class item's constructor parameter, so your way of implementing AddRange is
not supported in VS.net 2003. I hope I have explained it clearly.

I am not sure if VS 2005 supports this way of implementing AddRange method,
anyway, it is in beta version, and it is not in offical support now. So in
current VS.net 2003 version, the only supported way is passing class item
array as parameter for AddRange method.

Hope this information makes sense to you.
=============================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.



Relevant Pages

  • Re: Initialize an array of classes?
    ... Currently you cannot use member initialization list for a nonstatic array of a class if it does not have a default constructor. ... however you may encounter the warning C4351 and I do not think that it is useful to use such initialization for an array. ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Rationale for C++/CLI Value Types not having a default constructor
    ... Infrastructure) does support value types with parameterless constructors, ... The most obvious reason why parameterless ctros are not supported is fast array initialization. ... If the programmer wants to provide a user-defined default constructor for a type, then filling an array should construct each value of that type with that default constructor. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Generic C# List<> resize vs. Template C++ vector resize
    ... Then call the array's .Initialize method. ... Then pass the array to the generic's ..AddRange method. ... call the default constructor if necessary (or I can supply an instance ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Windows Form Designer generated code
    ... In VS.NET 2003, the part of 'Windows Form Designer generated code' contains a constructor and the InitializeComponent method, and these code is located in the form.vb file. ... You could put your initialization code either in the constructor or the Load event handler of the form. ... The MSDN Managed Newsgroup support offering is for non-urgent issues where an initial response from the community or a Microsoft Support Engineer within 1 business day is acceptable. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Object oriented stuff and browsers related thing
    ... with Netscape 2.0 being the first browser to support ... iff MyConstr() is called as a constructor. ... It refers to `MyConstr' as that would be the ...
    (comp.lang.javascript)