AGL Error

C

Chris Oswald

I am getting an exception that I cant figure out. It's very very
intermittent. I hope someone can shed some light on this. I
apologize if this post is hard to follow.

The exception occurs in
at Microsoft.AGL.Common.MISC.HandleAr().
at System.Windows.Forms.ScrollBar._SetInfo()
at System.Windows.Forms.ScrollBar.set_Value()

It happens when I set the value on a scrollbar. I used Reflector to
narrow down the code, but I'm not sure how to determine the error
because the HandleAR method just throws System.Exception. I have
attached the method to explain what I mean. How in the jack am I
supposed to figure out what the PAL_ERROR is. It obviously isn't one
of the errors microsoft planned for. It isn't documented at all of
course.

Friend Shared Sub HandleAr(ByVal ar As PAL_ERROR)
If (ar < PAL_ERROR.Success) Then
Select Case ar
Case PAL_ERROR.OOM
Throw New OutOfMemoryException
Case PAL_ERROR.InvalidHandle
Throw New ObjectDisposedException("")
Case PAL_ERROR.BadParam
Throw New ArgumentException
Case PAL_ERROR.NYI
Throw New NotSupportedException
Case PAL_ERROR.InvalidThreadId
Throw New NotSupportedException(Res.GetString(0, New
Object(0 - 1) {}))
End Select
Throw New Exception
End If
End Sub
 
G

Guest

Are you trying to set it to a value larger than a 16-bit short? While the
CF takes a 32-bit int, CE uses only a short (unlike the desktop).


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
 
G

Guest

If you are using CF 2, then the exception may have an inner exception that
may provide more details. The error you wrote below does look like an
exception I've seen in the past. I've seen the same type of error when I
tried to set a parameter on a control from outside of the form's thread. If
that is the case, then you would need to check form Form.InvokeRequired and
call Form.Invoke to call the method if the property is true. Good luck.

Regards,
R. Davis
Contractor
 
C

Chris Oswald

If you are using CF 2, then the exception may have an inner exception that
may provide more details. The error you wrote below does look like an
exception I've seen in the past. I've seen the same type of error when I
tried to set a parameter on a control from outside of the form's thread. If
that is the case, then you would need to check form Form.InvokeRequired and
call Form.Invoke to call the method if the property is true. Good luck.

Regards,
R. Davis
Contractor








- Show quoted text -

I am setting the scrollbar with the following line of code.

Me.ScrollBar.Value = 0

So I don't think it has anything to do with the size of the value. I
also know I'm on the UI thread that created the control. I already
checked that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top