473,408 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Visual Studio Internal Compiler Error FIX

Don't have the fix I need it. This is the exact problem from microsoft:

http://support.microsoft.com/default...b;en-us;819349

They do a nice job describing it and how to reproduce it. They say "yes its
a bug".

How do I fix it? Any ideas? Thanks
Nov 19 '05 #1
9 2789
"String" <ke*****@shaw.ca> wrote in message
news:fb*********************@news0.telusplanet.net ...
Don't have the fix I need it. This is the exact problem from microsoft:

http://support.microsoft.com/default...b;en-us;819349

They do a nice job describing it and how to reproduce it. They say "yes its a bug".

How do I fix it? Any ideas? Thanks


Can you post your code? What exactly are you trying to do? I don't see a
need for a fix...

Jeremy

Nov 19 '05 #2
Dim cb() As New ComboBox()

Protected Overrides Sub OnCreateControl()

AddHandler cb.SelectedIndexChanged, AddressOf ComboBox_TextChanged

End Sub

I am creating a custom datagrid with comboboxes in whatever columns the
designer wishes. The above code is what causes VS to crash. It works fine
with a single combobox(not an array) but as soon as I create a combo box
array the problem arises. There must be a different way to do this but I
need a dynamic-unknown number of comboboxes so an array of them would be the
best and easiest way of doing it. Any two cents appreciated. Thanks

"Jeremy Cowles" <je*************************@asifl.com> wrote in message
news:no*********************@twister.tampabay.rr.c om...
"String" <ke*****@shaw.ca> wrote in message
news:fb*********************@news0.telusplanet.net ...
Don't have the fix I need it. This is the exact problem from microsoft:

http://support.microsoft.com/default...b;en-us;819349

They do a nice job describing it and how to reproduce it. They say "yes

its
a bug".

How do I fix it? Any ideas? Thanks


Can you post your code? What exactly are you trying to do? I don't see a
need for a fix...

Jeremy

Nov 19 '05 #3
"String" <ke*****@shaw.ca> wrote in message
news:TP*********************@news0.telusplanet.net ...
Dim cb() As New ComboBox()

Protected Overrides Sub OnCreateControl()

AddHandler cb.SelectedIndexChanged, AddressOf ComboBox_TextChanged

End Sub

Keep in mind that an array is a Data Type, unlike VB 6 it is an object in
and of itself (with some neat tricks when you declare an Array of a specific
type). It makes no sense to put an event handler on it (at least not in
this case). What you are saying is this: "When the array's SelectedIndex
Property changes, fire this event", when in reality, the array has no such
event, the event is a member of the array contents, not the array itself. So
what you want to do is loop through each item in the list/array and process
them seperatly. I don't fully understand why the IDE even let you do this
in the first place - it should throw a syntax error.

Try this code:

Dim cb( ) As New ComboBox()

Protected Overrides Sub OnCreateControl( )
Dim cbThis as ComboBox

For Each cbThis in cb
AddHandler cb.SelectedIndexChanged, AddressOf ComboBox_TextChanged
Next
End Sub
HTH,
Jeremy


I am creating a custom datagrid with comboboxes in whatever columns the
designer wishes. The above code is what causes VS to crash. It works fine with a single combobox(not an array) but as soon as I create a combo box
array the problem arises. There must be a different way to do this but I
need a dynamic-unknown number of comboboxes so an array of them would be the best and easiest way of doing it. Any two cents appreciated. Thanks

Nov 19 '05 #4
Sorry, there is a bug in the example i posted... see inline fix:

Try this code:

Dim cb( ) As New ComboBox()

Protected Overrides Sub OnCreateControl( )
Dim cbThis as ComboBox

For Each cbThis in cb

Replace this:
AddHandler cb.SelectedIndexChanged, AddressOf ComboBox_TextChanged
With this:

AddHandler cbThis.SelectedIndexChanged, AddressOf ComboBox_TextChanged

Next
End Sub


Nov 19 '05 #5
Thanks. I see what you're saying and it makes sense. Unfortunely Visual
Studio crashes in the exact same way with your code. Any other suggestions?

"Jeremy Cowles" <je*************************@asifl.com> wrote in message
news:yY*********************@twister.tampabay.rr.c om...
Sorry, there is a bug in the example i posted... see inline fix:

Try this code:

Dim cb( ) As New ComboBox()

Protected Overrides Sub OnCreateControl( )
Dim cbThis as ComboBox

For Each cbThis in cb

Replace this:
AddHandler cb.SelectedIndexChanged, AddressOf

ComboBox_TextChanged
With this:

AddHandler cbThis.SelectedIndexChanged, AddressOf ComboBox_TextChanged

Next
End Sub

Nov 19 '05 #6
"String" <ke*****@shaw.ca> wrote in message
news:3g*********************@news0.telusplanet.net ...
Thanks. I see what you're saying and it makes sense. Unfortunely Visual
Studio crashes in the exact same way with your code. Any other suggestions?
Did you use my bug fix (it will crash with out it)?


"Jeremy Cowles" <je*************************@asifl.com> wrote in message
news:yY*********************@twister.tampabay.rr.c om...
Sorry, there is a bug in the example i posted... see inline fix:

Try this code:

Dim cb( ) As New ComboBox()

Protected Overrides Sub OnCreateControl( )
Dim cbThis as ComboBox

For Each cbThis in cb

Replace this:
AddHandler cb.SelectedIndexChanged, AddressOf

ComboBox_TextChanged

With this:

AddHandler cbThis.SelectedIndexChanged, AddressOf ComboBox_TextChanged

Next
End Sub



Nov 19 '05 #7
Your right that seemed to fix visual studio from crashing. Maybe I got a
little over my head here. Below is posted my entire control code. I hope you
don't mind taking a look and see how to make your suggestion work in my code
or my code work with yours. Most of this code is taken from Microsoft. I
relize its nowhere neat complete and some places might make no sense. The
reason for this is cause I made it work with 1 combo box and now I'm trying
to accomidate it for multiple. Thanks alot.

Public Class CustomDataGrid

Inherits System.Windows.Forms.DataGrid

Dim intCol As Integer

Dim cb() As ComboBox

Dim alComboCols As New Collection()

Public Sub FillCombo(ByVal column As Integer, ByVal items As Collection)

Dim i As Integer

Me.Controls.Add(cb(0))

alComboCols.Add(column)

If column = 3 Then

Me.Controls.Add(cb(1))

alComboCols.Add(column)

For i = 1 To items.Count

cb(0).Items.Add(items.Item(i))

Next i

End If

For i = 1 To items.Count

cb(0).Items.Add(items.Item(i))

Next i

intCol = column

End Sub

Private Sub CustomDG_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint

Dim i As Integer

For i = 1 To alComboCols.Count

If Me.CurrentCell.ColumnNumber = alComboCols.Item(i) Then

cb(i - 1).Width = Me.GetCurrentCellBounds.Width

End If

Next i

End Sub

Private Sub CustomDG_CurrentCellChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.CurrentCellChanged

Dim i As Integer

For i = 1 To alComboCols.Count

If Me.CurrentCell.ColumnNumber = alComboCols.Item(i)
Then

cb(i - 1).Visible = False

cb(i - 1).Width = 0

cb(i - 1).Left =
Me.GetCurrentCellBounds.Left

cb(i - 1).Top = Me.GetCurrentCellBounds.Top

cb(i - 1).Text = Me.Item(Me.CurrentCell) &
""

cb(i - 1).Visible = True

Else

cb(i - 1).Visible = False

cb(i - 1).Width = 0

End If

Next i

End Sub

Private Sub CustomDG_Scroll(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Scroll

'cb.Visible = False

'cb.Width = 0

End Sub

Private Sub CustomDG_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Click

'cb.Visible = False

'cb.Width = 0

End Sub

Private Sub Ctrls_TextChanged(ByVal sender As Object, ByVal e As
System.EventArgs)

Dim i As Integer

For i = 1 To alComboCols.Count

If Me.CurrentCell.ColumnNumber = alComboCols.Item(i) Then

cb(i - 1).Visible = False

If Me.Item(Me.CurrentCell) & "" = "" Then

'SendKeys.Send("*")

End If

Me.Item(Me.CurrentCell) = cb(i - 1).Text

End If

Next i

End Sub

Protected Overrides Sub OnCreateControl()

Dim cbThis As New ComboBox()

For Each cbThis In cb

AddHandler cbThis.SelectedIndexChanged, AddressOf
Ctrls_TextChanged

Next

End Sub

End Class
Nov 19 '05 #8
Sorry I guess that was a bit too much to ask. I guess all that is confusing
me is: why do I need cbThis? When I display and use a combobox am I using
cb() or cbThis? Do I set cb(0) = cbThis, cb(1) = cbThis? Am I completely
mixed up? Thanks
Nov 19 '05 #9
"String" <ke*****@shaw.ca> wrote in message
news:20*********************@news0.telusplanet.net ...
Sorry I guess that was a bit too much to ask. I guess all that is confusing me is: why do I need cbThis? When I display and use a combobox am I using
cb() or cbThis? Do I set cb(0) = cbThis, cb(1) = cbThis? Am I completely
mixed up? Thanks


Lookup the definition of For...Each, you will find that a for...each loop
iterates through each item in a collection, cbThis is a pointer moving to
each item in the list.

This:

Dim cbThis as ComboBox
For Each cbThis in cb( )
Debug.WriteLine cbThis.Name
Next

Is equivilent to this:

Dim i as Integer
For I = 0 to cbThis.GetUpperBound(0)
Debug.WriteLine cb( i ).Name
Next
I like the prior just because it is more concise (don't need to think about
an indicies, or the bounds of the array). I just don't have time to look
through your code, sorry, but from what I saw, it doesn't seem like you need
an array of combo boxes, just one would do. Are you trying to show a combo
box in the cell of a data grid? What exactly are you trying to accomplish?

Jeremy

Nov 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Stephen Horne | last post by:
I started making up a Python extension module to wrap a C++ library of mine using Boost Python. Trouble is, the library has a number of classes each of which has a lot of methods. I seem to have...
6
by: Martin Bless | last post by:
The good news: Along with Python-2.4 comes really good news to Windows users. Yes, you now CAN build extension modules yourself using the SAME C++ compiler and linker Python is built with...
0
by: Alex | last post by:
Hi, I have a problem with the VB.NET compiler: When I open my solution I recive the message : "Visual Basic .Net compiler is unable to recover from the following error : System Error...
5
by: K. Shier | last post by:
when attempting to edit code in a class file, i see the bug "Visual Basic ..NET compiler is unable to recover from the following error: System Error &Hc0000005&(Visual Basic internal compiler...
0
by: Runge Developer | last post by:
When compiling a VB.NET assembly we reguarly have the problem where it either hangs or produces the following error: ----- Visual Basic .NET compiler is unable to recover from the following error:...
19
by: Alf P. Steinbach | last post by:
// As usual the error message directs one to the report the bug. // // And as usual there is absolutely no way to do so without paying for // the privilege... // // Or using three or four hours...
5
by: Anton Noll | last post by:
We are using Visual Studio 2003.NET (C++) for the development of our software in the fields digital signal processing and numerical acoustics. One of our programs was working correctly if we are...
1
by: Runge Developer | last post by:
When compiling a VB.NET assembly we reguarly have the problem where it either hangs or produces the following error: ----- Visual Basic .NET compiler is unable to recover from the following error:...
6
by: Dusan Jan | last post by:
I get the following message when compiling or by background compile: Visual Basic .NET compiler is unable to recover from the following error: System Error &Hc0000005& (Visual Basic internal...
16
Frinavale
by: Frinavale | last post by:
The following article is directed at people who are experiencing an HTTP/1.1 500 Internal Server Error while using Visual Studio 2003. The error message typically sounds something like: The web...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.