473,385 Members | 1,337 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,385 software developers and data experts.

Random Crash in my .NET Program

I am getting a random crash in my program. I think it has to do with the
only listbox I have. It uses the WMP to play songs and when a song completes
I set the selected item in the listbox. I am assuming that is has to do with
the listbox because of this line:

"at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)"

and the listbox is the only part of my program that has a scrollable control.
Any help in fixing this would be greatly appreciated.

Here is the debug info:

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************

System.NullReferenceException: Object reference not set to an instance of an
object.

at System.Windows.Forms.UnsafeNativeMethods.CallWindo wProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)

at System.Windows.Forms.NativeWindow.DefWndProc(Messa ge& m)

at System.Windows.Forms.Control.DefWndProc(Message& m)

at System.Windows.Forms.Control.WmUpdateUIState(Messa ge& m)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)

at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)

at System.Windows.Forms.ParkingWindow.WndProc(Message & m)

at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)

at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
Thanks,

Renzska
Jul 21 '05 #1
6 1739
Could you provide some sample code?

Thanks, Sebastian Dau

"Renzska" <Re*****@discussions.microsoft.com> wrote in message
news:E4**********************************@microsof t.com...
I am getting a random crash in my program. I think it has to do with the
only listbox I have. It uses the WMP to play songs and when a song
completes
I set the selected item in the listbox. I am assuming that is has to do
with
the listbox because of this line:

"at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)"

and the listbox is the only part of my program that has a scrollable
control.
Any help in fixing this would be greatly appreciated.

Here is the debug info:

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************

System.NullReferenceException: Object reference not set to an instance of
an
object.

at System.Windows.Forms.UnsafeNativeMethods.CallWindo wProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)

at System.Windows.Forms.NativeWindow.DefWndProc(Messa ge& m)

at System.Windows.Forms.Control.DefWndProc(Message& m)

at System.Windows.Forms.Control.WmUpdateUIState(Messa ge& m)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)

at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)

at System.Windows.Forms.ParkingWindow.WndProc(Message & m)

at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)

at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
Thanks,

Renzska

Jul 21 '05 #2
Could you provide some sample code?

Thanks, Sebastian Dau

"Renzska" <Re*****@discussions.microsoft.com> wrote in message
news:E4**********************************@microsof t.com...
I am getting a random crash in my program. I think it has to do with the
only listbox I have. It uses the WMP to play songs and when a song
completes
I set the selected item in the listbox. I am assuming that is has to do
with
the listbox because of this line:

"at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)"

and the listbox is the only part of my program that has a scrollable
control.
Any help in fixing this would be greatly appreciated.

Here is the debug info:

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************

System.NullReferenceException: Object reference not set to an instance of
an
object.

at System.Windows.Forms.UnsafeNativeMethods.CallWindo wProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)

at System.Windows.Forms.NativeWindow.DefWndProc(Messa ge& m)

at System.Windows.Forms.Control.DefWndProc(Message& m)

at System.Windows.Forms.Control.WmUpdateUIState(Messa ge& m)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)

at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)

at System.Windows.Forms.ParkingWindow.WndProc(Message & m)

at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)

at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
Thanks,

Renzska

Jul 21 '05 #3
public void setSelected(int track)
{
listFormPlayList.SetSelected(track, true);
}

That is what I am doing. But I call it in a lot of different places. Could
that be the cause of my problem?

Thanks,

Renzska

"Sebastian Dau" wrote:
Could you provide some sample code?

Thanks, Sebastian Dau

"Renzska" <Re*****@discussions.microsoft.com> wrote in message
news:E4**********************************@microsof t.com...
I am getting a random crash in my program. I think it has to do with the
only listbox I have. It uses the WMP to play songs and when a song
completes
I set the selected item in the listbox. I am assuming that is has to do
with
the listbox because of this line:

"at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)"

and the listbox is the only part of my program that has a scrollable
control.
Any help in fixing this would be greatly appreciated.

Here is the debug info:

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************

System.NullReferenceException: Object reference not set to an instance of
an
object.

at System.Windows.Forms.UnsafeNativeMethods.CallWindo wProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)

at System.Windows.Forms.NativeWindow.DefWndProc(Messa ge& m)

at System.Windows.Forms.Control.DefWndProc(Message& m)

at System.Windows.Forms.Control.WmUpdateUIState(Messa ge& m)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)

at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)

at System.Windows.Forms.ParkingWindow.WndProc(Message & m)

at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)

at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
Thanks,

Renzska


Jul 21 '05 #4
public void setSelected(int track)
{
listFormPlayList.SetSelected(track, true);
}

That is what I am doing. But I call it in a lot of different places. Could
that be the cause of my problem?

Thanks,

Renzska

"Sebastian Dau" wrote:
Could you provide some sample code?

Thanks, Sebastian Dau

"Renzska" <Re*****@discussions.microsoft.com> wrote in message
news:E4**********************************@microsof t.com...
I am getting a random crash in my program. I think it has to do with the
only listbox I have. It uses the WMP to play songs and when a song
completes
I set the selected item in the listbox. I am assuming that is has to do
with
the listbox because of this line:

"at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)"

and the listbox is the only part of my program that has a scrollable
control.
Any help in fixing this would be greatly appreciated.

Here is the debug info:

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************

System.NullReferenceException: Object reference not set to an instance of
an
object.

at System.Windows.Forms.UnsafeNativeMethods.CallWindo wProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)

at System.Windows.Forms.NativeWindow.DefWndProc(Messa ge& m)

at System.Windows.Forms.Control.DefWndProc(Message& m)

at System.Windows.Forms.Control.WmUpdateUIState(Messa ge& m)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)

at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)

at System.Windows.Forms.ParkingWindow.WndProc(Message & m)

at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)

at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
Thanks,

Renzska


Jul 21 '05 #5
Hello,

NullReferenceExceptions in this native methods mostly happen
when own code mixes something up while running inside
of the native window thread.

Are your sure that track in your method call

listFormPlayList.SetSelected(track, true);

is not set to some value out of range?
Greets, Sebastian Dau

"Renzska" <Re*****@discussions.microsoft.com> wrote in message
news:DF**********************************@microsof t.com...
public void setSelected(int track)
{
listFormPlayList.SetSelected(track, true);
}

That is what I am doing. But I call it in a lot of different places.
Could
that be the cause of my problem?

Thanks,

Renzska

"Sebastian Dau" wrote:
Could you provide some sample code?

Thanks, Sebastian Dau

"Renzska" <Re*****@discussions.microsoft.com> wrote in message
news:E4**********************************@microsof t.com...
>I am getting a random crash in my program. I think it has to do with
>the
> only listbox I have. It uses the WMP to play songs and when a song
> completes
> I set the selected item in the listbox. I am assuming that is has to
> do
> with
> the listbox because of this line:
>
> "at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)"
>
> and the listbox is the only part of my program that has a scrollable
> control.
>
>
> Any help in fixing this would be greatly appreciated.
>
> Here is the debug info:
>
> See the end of this message for details on invoking
>
> just-in-time (JIT) debugging instead of this dialog box.
>
>
>
> ************** Exception Text **************
>
> System.NullReferenceException: Object reference not set to an instance
> of
> an
> object.
>
> at System.Windows.Forms.UnsafeNativeMethods.CallWindo wProc(IntPtr
> wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
>
> at System.Windows.Forms.NativeWindow.DefWndProc(Messa ge& m)
>
> at System.Windows.Forms.Control.DefWndProc(Message& m)
>
> at System.Windows.Forms.Control.WmUpdateUIState(Messa ge& m)
>
> at System.Windows.Forms.Control.WndProc(Message& m)
>
> at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
>
> at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
>
> at System.Windows.Forms.ParkingWindow.WndProc(Message & m)
>
> at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
>
> at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
>
> at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
> IntPtr wparam, IntPtr lparam)
>
>
> Thanks,
>
> Renzska
>


Jul 21 '05 #6
Shouldn't be, but I'll check it out just to make sure.

Thanks,

Renzska

"Sebastian Dau" wrote:
Hello,

NullReferenceExceptions in this native methods mostly happen
when own code mixes something up while running inside
of the native window thread.

Are your sure that track in your method call

listFormPlayList.SetSelected(track, true);

is not set to some value out of range?
Greets, Sebastian Dau

"Renzska" <Re*****@discussions.microsoft.com> wrote in message
news:DF**********************************@microsof t.com...
public void setSelected(int track)
{
listFormPlayList.SetSelected(track, true);
}

That is what I am doing. But I call it in a lot of different places.
Could
that be the cause of my problem?

Thanks,

Renzska

"Sebastian Dau" wrote:
Could you provide some sample code?

Thanks, Sebastian Dau

"Renzska" <Re*****@discussions.microsoft.com> wrote in message
news:E4**********************************@microsof t.com...
>I am getting a random crash in my program. I think it has to do with
>the
> only listbox I have. It uses the WMP to play songs and when a song
> completes
> I set the selected item in the listbox. I am assuming that is has to
> do
> with
> the listbox because of this line:
>
> "at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)"
>
> and the listbox is the only part of my program that has a scrollable
> control.
>
>
> Any help in fixing this would be greatly appreciated.
>
> Here is the debug info:
>
> See the end of this message for details on invoking
>
> just-in-time (JIT) debugging instead of this dialog box.
>
>
>
> ************** Exception Text **************
>
> System.NullReferenceException: Object reference not set to an instance
> of
> an
> object.
>
> at System.Windows.Forms.UnsafeNativeMethods.CallWindo wProc(IntPtr
> wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
>
> at System.Windows.Forms.NativeWindow.DefWndProc(Messa ge& m)
>
> at System.Windows.Forms.Control.DefWndProc(Message& m)
>
> at System.Windows.Forms.Control.WmUpdateUIState(Messa ge& m)
>
> at System.Windows.Forms.Control.WndProc(Message& m)
>
> at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
>
> at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
>
> at System.Windows.Forms.ParkingWindow.WndProc(Message & m)
>
> at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
>
> at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
>
> at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
> IntPtr wparam, IntPtr lparam)
>
>
> Thanks,
>
> Renzska
>


Jul 21 '05 #7

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

Similar topics

7
by: Oin Zea | last post by:
Is it possible for to program to access a random file at the same time and perform actions like create a new record?
48
by: Joseph | last post by:
Hi I'm writing a commercial program which must be reliable. It has to do some basic reading and writing to and from files on the hard disk, and also to a floppy. I have foreseen a potential...
9
by: greeningster | last post by:
I have written an application in Visual C++ for a customer but it seems to crash randomly. Could anyone give me any help on how I could track this down ? Also, there appears there might be...
4
by: arizvi | last post by:
Hi, My program crashes when it reaches a certain line. There is nothing wrong with that particular line as I have changed it to something simple like i=0, and it still crashes. If I remove...
4
by: Jared Kitcher via .NET 247 | last post by:
I am working on a .Net project and our application randomlycrashes with no exception being thrown. The application justdisappears, like someone would have clicked the exit button. This occurs both...
4
by: Renzska | last post by:
I am getting a random crash in my program. I think it has to do with the only listbox I have. It uses the WMP to play songs and when a song completes I set the selected item in the listbox. I am...
34
by: NewToCPP | last post by:
Hi, Why does a C/C++ programs crash? When there is access to a null pointer or some thing like that programs crash, but why do they crash? Thanks.
12
by: benjamin.krulewitch | last post by:
I'm debugging an issue with a C program that causes the computer to crash, and I'm attempting to log information immediately before the crash occurs. I us my BKprintLog function (see below) to...
6
by: Mike Langworthy | last post by:
i can not seem to get this code to work. someone please help using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program {
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.