Hello,
Visual C++ .NET 2005 raises an error in the form editor using a
UserControl that has an ArrayList property on it. This doesn't happen
in C#.
The error message is:
|
One
or more errors encountered while loading the designer. The errors are
listed below. Some errors can be fixed by rebuilding your project,
while others may require code changes. |
Either VCProject or VCCodeModel is not ready yet. Please close designer and try again. Hide |
|
at Microsoft.VisualC.CppCodeParser.Parse(TextReader codeStream) at System.CodeDom.Compiler.CodeDomProvider.Parse(TextReader codeStream) at Microsoft.VisualStudio.Shell.Design.Serialization.CodeDom.CodeDomDocDataAdapter.get_CompileUnit() at
Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager
serializationManager) at
Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32
fReload)
|
The code of the UserControl is:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
namespace ListFailure
{
public partial class ListFailure : UserControl
{
public ListFailure()
{
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs e)
{
e.Graphics.FillRectangle(Brushes.Red, e.ClipRectangle);
base.OnPaint(e);
}
private StringList stringList;
public StringList StringList
{
get
{
if (stringList == null)
{
stringList = new StringList(100);
}
return stringList;
}
set { stringList = value; }
}
}
public class StringList : List<string>
{
public StringList() { }
public StringList(int capacity) : base(capacity) { }
}
}
This UserControl is just a simple example to reproduce the problem. The real problem is found using a custom control, which uses ArrayLists, in a managed C++ form.
Is there anything that can be done to solve this problem?
Thanks in advance.