Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / September 2004

Tip: Looking for answers? Try searching our database.

scrollbar problem..

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul Lo - 31 Aug 2004 09:57 GMT
Dear all,

  I'm writting a .net winForm application with C#, but I'm getting the
following exception when the user scrolls a scrollbar. The strange thing is
that the exception happens only some of the time, and seems pretty random.
However, once an exception occurs with a scrollbar and when I choose
'continue', that particular scrollbar will raise the exception everytime I
click on it from that point on.

  Anyone encounter the same problem before? Any solution to this problem?
At the very least I wanna know how I could catch that exception..

Thanks~!
Paul

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an
object.
  at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
  at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
  at System.Windows.Forms.Control.DefWndProc(Message& m)
  at System.Windows.Forms.Control.WndProc(Message& m)
  at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
  at System.Windows.Forms.ContainerControl.WndProc(Message& m)
  at System.Windows.Forms.UserControl.WndProc(Message& m)
  at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
  at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
  at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
mavisahdas - 31 Aug 2004 12:19 GMT
Hi paul,
Before answering this question... i want to know the following things

So you have a scroll bar control in ur application was is a scroll bar
attached to some other control.

Have u handled any event i mean do u have any Scroll event attached to that
scroll bar.

This null reference exception will occur only when the object is not
initialised or only when it is dereferenced. So, there are cases where the
objects get disposed... if you have any code written in the scroll event, pls
send me that code also.

Answer these question this will help me solving this problem.. you can reach
me at sadhasivam1981@yahoo.com, sadhasivam1981@hotmail.com.

With regards,

Sadha Sivam S,
Microsoft Community Star,
KMG Info Tech.
Vist http://www.dotnetspider.com for more dot net updates

> Dear all,
>
[quoted text clipped - 26 lines]
>    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
> IntPtr wparam, IntPtr lparam)
Paul Lo - 01 Sep 2004 02:26 GMT
Hi Sadha,

Thanks for your reply. Actually I have both types of scrollbar that you
mentioned. I have a scrollbar control that is attached to a customer control
that I made. And Yes, I have the scroll event attached to this scrollbar
control. Besides, I am also using MDI, the mdi child got a scrollbar when it
is displayed inside the mdi parent form. Both of these scrollbars got the
same problem, occasionally. That really made me frustrated.

If there is some object that I forgot to initialize or dereferenced, guess
the error should happen every time, but it's not the case. It seems strange
to me that such exception is generated from
System.Windows.Forms.UnsafeNativeMethods.CallWindowProc, and in fact
everything in the call stack are internal method calls within the framework.

Hope the above could give you some clue to my problem..

Paul

> Hi paul,
> Before answering this question... i want to know the following things
[quoted text clipped - 50 lines]
> >    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
> > IntPtr wparam, IntPtr lparam)
Mavisahdas - 01 Sep 2004 06:41 GMT
hi paul,

Can u pls send the code of ur scroll event...

With regards,

Sadha Sivam S,
Microsoft Community Star,
KMG Info Tech,
Bangalore,
Mobile: 9880397583
Charles Collins - 10 Sep 2004 16:28 GMT
I have an application that is throwing the same error, but only when run
through terminal server.  We have yet to see it in any other instance and it
is totally random and sporadic.  A solution to this issue would be greatly
welcomed here too.
Charles

> Hi Sadha,
>
[quoted text clipped - 85 lines]
>> > msg,
>> > IntPtr wparam, IntPtr lparam)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.