"Unexpected error" strangeness...(ipaq vb.net)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've written an app that contacts a web server in order to log in, grab and
display info based on serial numbers entered, and add the info to a "cart" of
sorts on the web server. It's in vb.net, and uses InputBox(...) for the
login form (which is shown in the main form's Load event handler) and
HttpWebRequest objects to communicate with the server.

The app ran fine in the emulator that comes with vs.net 2003, so i made an
msi of it and shared it for testing. The installer appeared to work fine as
well, but upon running the program we see all sorts of strangeness...

* The input panel doesn't appear on the menu bar for the login form (a modal
dialog a la InputBox).
* MSN Messenger is the active form when the login form is closed. Messenger
was not running when the app started.
* The tester has a keyboard installed, and managed to fill in the login
form. Once he hit "ok", the main form popped up....but immediately, a
message about an "unexpected error" appeared--IN THE INFO TEXTBOX. No
dialog, no "details" button, none of that. The error appeared, the main form
stayed for another half second or so, and then the app died.
* All this happens every time the app runs. I'd probably see more
strangeness if i could keep it running. :P

The testing PDA is an iPaq 5450 (PPC 2002, windows v3.0.11171 [build 11178])
with .net CF v1.0 SP2. The emulator appears to be running .net v1.0, but the
windows version number is identical to the PDA's. Both machines have plenty
of memory left.
 
Is there any way you can get a PDA, and connect it to your development box?
You'd be able to debug and step through your application to find out more
details of what's going wrong.

If not, distribute a debug build, and saturate the source with debug logging
comments which log details of stages to disk, and allow you then to track
where the application got to, where it didn't and what errors are coming up.

Finally, ensure you're using try/catches, and get the Exception.Message and
Exception.StackTrace to help narrow down the bugs.

Good luck!
 
The emulator is a wholly unsuitable target for testing a real application -
useful for basic beginning dev, but not testing. You must have real
hardware to test against.
 
Dan Bass said:
Is there any way you can get a PDA, and connect it to your development box?
You'd be able to debug and step through your application to find out more
details of what's going wrong.

If not, distribute a debug build, and saturate the source with debug logging
comments which log details of stages to disk, and allow you then to track
where the application got to, where it didn't and what errors are coming up.

Finally, ensure you're using try/catches, and get the Exception.Message and
Exception.StackTrace to help narrow down the bugs.

Heh. Shortly after posting the original message, i did all of that. I'm a
bit annoyed at myself for not having thought of it before i complained to
y'all, but i'm pretty new to VB and PDA development and thought it might be a
compatibility thing with the PDA. (From what i'd seen, an ipaq has more
little quirks than most other PDAs.)

Fun part is, once i put the logging and exception handling in, things
magically just worked. I took the logging out, and so far it still works.
The only thing i noticed was something about a WebException (for now i just
put in a generic exception handler that catches everything and MsgBox'es the
..message for it), but that was to be expected since the PDA didn't have
internet access at the time.

I'm still curious as to why the error message appeared in the textbox as
opposed to popping up a dialog...but as long as the stuff works, i can live
without worrying too much about that. :)

BTW...I've noticed on most forms, when you enter a text box the input panel
pops up. On my login form, though, it doesn't. (Recall that the login form
is really an InputBox, as the "login code" is a unique id.) Is there a way
to make this happen when one uses InputBox to ask for info, or do i have to
make a real form and have an event handler show the panel?

/
 
You should catch Focus event to activate a SIP and hide the SIP on
LostFocus event. The best way is to write your own TextBoxEx control
which is derived from TextBox control and call this function on
Focus/LostFocus events:


public static void SIPShow(bool show)
{
SipShowIM(show ? SIPF_ON : SIPF_OFF);
}

const uint SIPF_OFF = 0x0;
const uint SIPF_ON = 0x1;

[DllImport("coredll.dll")]
private extern static void SipShowIM(uint dwFlag);


Best regards,
Sergey Bogdanov
 
Finally, ensure you're using try/catches, and get the Exception.Message
and Exception.StackTrace to help narrow down the bugs.

Just to be clear, Exception.StackTrace is not supported on CF 1.0

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


Dan Bass said:
Is there any way you can get a PDA, and connect it to your development
box?
You'd be able to debug and step through your application to find out more
details of what's going wrong.

If not, distribute a debug build, and saturate the source with debug
logging comments which log details of stages to disk, and allow you then
to track where the application got to, where it didn't and what errors are
coming up.

Finally, ensure you're using try/catches, and get the Exception.Message
and Exception.StackTrace to help narrow down the bugs.

Good luck!


I HATE PDAs said:
I've written an app that contacts a web server in order to log in, grab
and
display info based on serial numbers entered, and add the info to a
"cart" of
sorts on the web server. It's in vb.net, and uses InputBox(...) for the
login form (which is shown in the main form's Load event handler) and
HttpWebRequest objects to communicate with the server.

The app ran fine in the emulator that comes with vs.net 2003, so i made
an
msi of it and shared it for testing. The installer appeared to work fine
as
well, but upon running the program we see all sorts of strangeness...

* The input panel doesn't appear on the menu bar for the login form (a
modal
dialog a la InputBox).
* MSN Messenger is the active form when the login form is closed.
Messenger
was not running when the app started.
* The tester has a keyboard installed, and managed to fill in the login
form. Once he hit "ok", the main form popped up....but immediately, a
message about an "unexpected error" appeared--IN THE INFO TEXTBOX. No
dialog, no "details" button, none of that. The error appeared, the main
form
stayed for another half second or so, and then the app died.
* All this happens every time the app runs. I'd probably see more
strangeness if i could keep it running. :P

The testing PDA is an iPaq 5450 (PPC 2002, windows v3.0.11171 [build
11178])
with .net CF v1.0 SP2. The emulator appears to be running .net v1.0, but
the
windows version number is identical to the PDA's. Both machines have
plenty
of memory left.
 
Unless I have missed something in this thread, there is no need to pinvoke;
instead use InputPanel.Enabled = true/false as appropriate.

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


Sergey Bogdanov said:
You should catch Focus event to activate a SIP and hide the SIP on
LostFocus event. The best way is to write your own TextBoxEx control which
is derived from TextBox control and call this function on Focus/LostFocus
events:


public static void SIPShow(bool show)
{
SipShowIM(show ? SIPF_ON : SIPF_OFF);
}

const uint SIPF_OFF = 0x0;
const uint SIPF_ON = 0x1;

[DllImport("coredll.dll")]
private extern static void SipShowIM(uint dwFlag);


Best regards,
Sergey Bogdanov

:




Heh. Shortly after posting the original message, i did all of that. I'm
a bit annoyed at myself for not having thought of it before i complained
to y'all, but i'm pretty new to VB and PDA development and thought it
might be a compatibility thing with the PDA. (From what i'd seen, an
ipaq has more little quirks than most other PDAs.)

Fun part is, once i put the logging and exception handling in, things
magically just worked. I took the logging out, and so far it still
works. The only thing i noticed was something about a WebException (for
now i just put in a generic exception handler that catches everything and
MsgBox'es the .message for it), but that was to be expected since the PDA
didn't have internet access at the time.

I'm still curious as to why the error message appeared in the textbox as
opposed to popping up a dialog...but as long as the stuff works, i can
live without worrying too much about that. :)

BTW...I've noticed on most forms, when you enter a text box the input
panel pops up. On my login form, though, it doesn't. (Recall that the
login form is really an InputBox, as the "login code" is a unique id.)
Is there a way to make this happen when one uses InputBox to ask for
info, or do i have to make a real form and have an event handler show the
panel?

/
 
Yes, you are right that InputPanel can be showed as InputPanel.Enabled =
true but it requires that InputPanel must be placed on the form. I've
suggested more completed approach; TextBox shows/hides input panel
itself without any additional components.

Best regards,
Sergey Bogdanov


Daniel said:
Unless I have missed something in this thread, there is no need to pinvoke;
instead use InputPanel.Enabled = true/false as appropriate.

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


You should catch Focus event to activate a SIP and hide the SIP on
LostFocus event. The best way is to write your own TextBoxEx control which
is derived from TextBox control and call this function on Focus/LostFocus
events:


public static void SIPShow(bool show)
{
SipShowIM(show ? SIPF_ON : SIPF_OFF);
}

const uint SIPF_OFF = 0x0;
const uint SIPF_ON = 0x1;

[DllImport("coredll.dll")]
private extern static void SipShowIM(uint dwFlag);


Best regards,
Sergey Bogdanov

:



Is there any way you can get a PDA, and connect it to your development
box?
You'd be able to debug and step through your application to find out more
details of what's going wrong.

If not, distribute a debug build, and saturate the source with debug
logging comments which log details of stages to disk, and allow you then
to track where the application got to, where it didn't and what errors
are coming up.

Finally, ensure you're using try/catches, and get the Exception.Message
and Exception.StackTrace to help narrow down the bugs.


Heh. Shortly after posting the original message, i did all of that. I'm
a bit annoyed at myself for not having thought of it before i complained
to y'all, but i'm pretty new to VB and PDA development and thought it
might be a compatibility thing with the PDA. (From what i'd seen, an
ipaq has more little quirks than most other PDAs.)

Fun part is, once i put the logging and exception handling in, things
magically just worked. I took the logging out, and so far it still
works. The only thing i noticed was something about a WebException (for
now i just put in a generic exception handler that catches everything and
MsgBox'es the .message for it), but that was to be expected since the PDA
didn't have internet access at the time.

I'm still curious as to why the error message appeared in the textbox as
opposed to popping up a dialog...but as long as the stuff works, i can
live without worrying too much about that. :)

BTW...I've noticed on most forms, when you enter a text box the input
panel pops up. On my login form, though, it doesn't. (Recall that the
login form is really an InputBox, as the "login code" is a unique id.)
Is there a way to make this happen when one uses InputBox to ask for
info, or do i have to make a real form and have an event handler show the
panel?

/
 
Sergey Bogdanov said:
You should catch Focus event to activate a SIP and hide the SIP on
LostFocus event. The best way is to write your own TextBoxEx control which
is derived from TextBox control and call this function on Focus/LostFocus
events:

I know how i have to do it in my own forms.... but doing it that way
involves reworking the way i show the login box in the first place. Right
now, the code for the login stuff looks a bit like

loginCode = InputBox("Login", "Login")

which works....albeit with a little fighting between the two windows at
startup. (the title bar swaps between the login dialog and the main form a
few times before a window shows up.)

One might assume that a function whose sole purpose is to gather keyboard
input, would show a keyboard when the form popped up. :P

/
 
Sure... the Original VB Poster is now aware of both options. Note that
building a custom control with designer support is only possible with C#

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


Sergey Bogdanov said:
Yes, you are right that InputPanel can be showed as InputPanel.Enabled =
true but it requires that InputPanel must be placed on the form. I've
suggested more completed approach; TextBox shows/hides input panel itself
without any additional components.

Best regards,
Sergey Bogdanov


Daniel said:
Unless I have missed something in this thread, there is no need to
pinvoke; instead use InputPanel.Enabled = true/false as appropriate.

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


You should catch Focus event to activate a SIP and hide the SIP on
LostFocus event. The best way is to write your own TextBoxEx control
which is derived from TextBox control and call this function on
Focus/LostFocus events:


public static void SIPShow(bool show)
{
SipShowIM(show ? SIPF_ON : SIPF_OFF);
}

const uint SIPF_OFF = 0x0;
const uint SIPF_ON = 0x1;

[DllImport("coredll.dll")]
private extern static void SipShowIM(uint dwFlag);


Best regards,
Sergey Bogdanov


I HATE PDAs wrote:

:



Is there any way you can get a PDA, and connect it to your development
box?
You'd be able to debug and step through your application to find out
more details of what's going wrong.

If not, distribute a debug build, and saturate the source with debug
logging comments which log details of stages to disk, and allow you
then to track where the application got to, where it didn't and what
errors are coming up.

Finally, ensure you're using try/catches, and get the Exception.Message
and Exception.StackTrace to help narrow down the bugs.


Heh. Shortly after posting the original message, i did all of that.
I'm a bit annoyed at myself for not having thought of it before i
complained to y'all, but i'm pretty new to VB and PDA development and
thought it might be a compatibility thing with the PDA. (From what i'd
seen, an ipaq has more little quirks than most other PDAs.)

Fun part is, once i put the logging and exception handling in, things
magically just worked. I took the logging out, and so far it still
works. The only thing i noticed was something about a WebException (for
now i just put in a generic exception handler that catches everything
and MsgBox'es the .message for it), but that was to be expected since
the PDA didn't have internet access at the time.

I'm still curious as to why the error message appeared in the textbox as
opposed to popping up a dialog...but as long as the stuff works, i can
live without worrying too much about that. :)

BTW...I've noticed on most forms, when you enter a text box the input
panel pops up. On my login form, though, it doesn't. (Recall that the
login form is really an InputBox, as the "login code" is a unique id.)
Is there a way to make this happen when one uses InputBox to ask for
info, or do i have to make a real form and have an event handler show
the panel?

/
 
Drop an InputPanel control on the form that calls InputBox. Show the SIP
before the call and hide it after the call, i.e.:

InputPanel1.Enabled = True
loginCode = InputBox("Login", "Login")
InputPanel1.Enabled = False

Cheers
Daniel
 
..Net CF could be described as .Net with all the useful stuff... ;o)


Daniel Moth said:
Finally, ensure you're using try/catches, and get the Exception.Message
and Exception.StackTrace to help narrow down the bugs.

Just to be clear, Exception.StackTrace is not supported on CF 1.0

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


Dan Bass said:
Is there any way you can get a PDA, and connect it to your development
box?
You'd be able to debug and step through your application to find out more
details of what's going wrong.

If not, distribute a debug build, and saturate the source with debug
logging comments which log details of stages to disk, and allow you then
to track where the application got to, where it didn't and what errors
are coming up.

Finally, ensure you're using try/catches, and get the Exception.Message
and Exception.StackTrace to help narrow down the bugs.

Good luck!


I HATE PDAs said:
I've written an app that contacts a web server in order to log in, grab
and
display info based on serial numbers entered, and add the info to a
"cart" of
sorts on the web server. It's in vb.net, and uses InputBox(...) for the
login form (which is shown in the main form's Load event handler) and
HttpWebRequest objects to communicate with the server.

The app ran fine in the emulator that comes with vs.net 2003, so i made
an
msi of it and shared it for testing. The installer appeared to work
fine as
well, but upon running the program we see all sorts of strangeness...

* The input panel doesn't appear on the menu bar for the login form (a
modal
dialog a la InputBox).
* MSN Messenger is the active form when the login form is closed.
Messenger
was not running when the app started.
* The tester has a keyboard installed, and managed to fill in the login
form. Once he hit "ok", the main form popped up....but immediately, a
message about an "unexpected error" appeared--IN THE INFO TEXTBOX. No
dialog, no "details" button, none of that. The error appeared, the main
form
stayed for another half second or so, and then the app died.
* All this happens every time the app runs. I'd probably see more
strangeness if i could keep it running. :P

The testing PDA is an iPaq 5450 (PPC 2002, windows v3.0.11171 [build
11178])
with .net CF v1.0 SP2. The emulator appears to be running .net v1.0,
but the
windows version number is identical to the PDA's. Both machines have
plenty
of memory left.
 
I guess you meant "without"... The next version rectifies this :-)
http://www.danielmoth.com/Blog/2004/12/stacktrace.html

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


Dan Bass said:
.Net CF could be described as .Net with all the useful stuff... ;o)


Daniel Moth said:
Finally, ensure you're using try/catches, and get the Exception.Message
and Exception.StackTrace to help narrow down the bugs.

Just to be clear, Exception.StackTrace is not supported on CF 1.0

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


Dan Bass said:
Is there any way you can get a PDA, and connect it to your development
box?
You'd be able to debug and step through your application to find out
more details of what's going wrong.

If not, distribute a debug build, and saturate the source with debug
logging comments which log details of stages to disk, and allow you then
to track where the application got to, where it didn't and what errors
are coming up.

Finally, ensure you're using try/catches, and get the Exception.Message
and Exception.StackTrace to help narrow down the bugs.

Good luck!


I've written an app that contacts a web server in order to log in, grab
and
display info based on serial numbers entered, and add the info to a
"cart" of
sorts on the web server. It's in vb.net, and uses InputBox(...) for
the
login form (which is shown in the main form's Load event handler) and
HttpWebRequest objects to communicate with the server.

The app ran fine in the emulator that comes with vs.net 2003, so i made
an
msi of it and shared it for testing. The installer appeared to work
fine as
well, but upon running the program we see all sorts of strangeness...

* The input panel doesn't appear on the menu bar for the login form (a
modal
dialog a la InputBox).
* MSN Messenger is the active form when the login form is closed.
Messenger
was not running when the app started.
* The tester has a keyboard installed, and managed to fill in the login
form. Once he hit "ok", the main form popped up....but immediately, a
message about an "unexpected error" appeared--IN THE INFO TEXTBOX. No
dialog, no "details" button, none of that. The error appeared, the
main form
stayed for another half second or so, and then the app died.
* All this happens every time the app runs. I'd probably see more
strangeness if i could keep it running. :P

The testing PDA is an iPaq 5450 (PPC 2002, windows v3.0.11171 [build
11178])
with .net CF v1.0 SP2. The emulator appears to be running .net v1.0,
but the
windows version number is identical to the PDA's. Both machines have
plenty
of memory left.
 
i did, thought about posting again but didn't want to sound desperate. ;o)

when is this out? Does it have Xml.SelectSingleNode ???

Initially, I'll use CF 2.0 more than .Net framework 2.0 simply because the
devices running the windows capable of handling the new CF version will be
available before my clients have been persuaded to roll out the new .Net
framework (they've only just got to Win 2k and getting .Net 1.1 on there was
a mission!)



Daniel Moth said:
I guess you meant "without"... The next version rectifies this :-)
http://www.danielmoth.com/Blog/2004/12/stacktrace.html

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


Dan Bass said:
.Net CF could be described as .Net with all the useful stuff... ;o)


Daniel Moth said:
Finally, ensure you're using try/catches, and get the Exception.Message
and Exception.StackTrace to help narrow down the bugs.

Just to be clear, Exception.StackTrace is not supported on CF 1.0

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


"Dan Bass" <danielbass [at] postmaster [dot] co [dot] uk> wrote in
message Is there any way you can get a PDA, and connect it to your development
box?
You'd be able to debug and step through your application to find out
more details of what's going wrong.

If not, distribute a debug build, and saturate the source with debug
logging comments which log details of stages to disk, and allow you
then
to track where the application got to, where it didn't and what errors
are coming up.

Finally, ensure you're using try/catches, and get the Exception.Message
and Exception.StackTrace to help narrow down the bugs.

Good luck!


I've written an app that contacts a web server in order to log in,
grab
and
display info based on serial numbers entered, and add the info to a
"cart" of
sorts on the web server. It's in vb.net, and uses InputBox(...) for
the
login form (which is shown in the main form's Load event handler) and
HttpWebRequest objects to communicate with the server.

The app ran fine in the emulator that comes with vs.net 2003, so i
made
an
msi of it and shared it for testing. The installer appeared to work
fine as
well, but upon running the program we see all sorts of strangeness...

* The input panel doesn't appear on the menu bar for the login form (a
modal
dialog a la InputBox).
* MSN Messenger is the active form when the login form is closed.
Messenger
was not running when the app started.
* The tester has a keyboard installed, and managed to fill in the
login
form. Once he hit "ok", the main form popped up....but immediately, a
message about an "unexpected error" appeared--IN THE INFO TEXTBOX. No
dialog, no "details" button, none of that. The error appeared, the
main form
stayed for another half second or so, and then the app died.
* All this happens every time the app runs. I'd probably see more
strangeness if i could keep it running. :P

The testing PDA is an iPaq 5450 (PPC 2002, windows v3.0.11171 [build
11178])
with .net CF v1.0 SP2. The emulator appears to be running .net v1.0,
but the
windows version number is identical to the PDA's. Both machines have
plenty
of memory left.
 
XmlNode.SelectSingleNode appears to be supported in the November CTP which
is the one I suggest you have a play with if you have access to it. VS2005
(which is what CF 2.0 is part of) will RTM in 2005 with expectations being
by end of summer but no official word yet.

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


Dan Bass said:
i did, thought about posting again but didn't want to sound desperate. ;o)

when is this out? Does it have Xml.SelectSingleNode ???

Initially, I'll use CF 2.0 more than .Net framework 2.0 simply because the
devices running the windows capable of handling the new CF version will be
available before my clients have been persuaded to roll out the new .Net
framework (they've only just got to Win 2k and getting .Net 1.1 on there
was a mission!)



Daniel Moth said:
I guess you meant "without"... The next version rectifies this :-)
http://www.danielmoth.com/Blog/2004/12/stacktrace.html

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


"Dan Bass" <danielbass [at] postmaster [dot] co [dot] uk> wrote in
message
.Net CF could be described as .Net with all the useful stuff... ;o)


Finally, ensure you're using try/catches, and get the
Exception.Message
and Exception.StackTrace to help narrow down the bugs.

Just to be clear, Exception.StackTrace is not supported on CF 1.0

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


"Dan Bass" <danielbass [at] postmaster [dot] co [dot] uk> wrote in
message Is there any way you can get a PDA, and connect it to your development
box?
You'd be able to debug and step through your application to find out
more details of what's going wrong.

If not, distribute a debug build, and saturate the source with debug
logging comments which log details of stages to disk, and allow you
then
to track where the application got to, where it didn't and what errors
are coming up.

Finally, ensure you're using try/catches, and get the
Exception.Message
and Exception.StackTrace to help narrow down the bugs.

Good luck!


I've written an app that contacts a web server in order to log in,
grab
and
display info based on serial numbers entered, and add the info to a
"cart" of
sorts on the web server. It's in vb.net, and uses InputBox(...) for
the
login form (which is shown in the main form's Load event handler) and
HttpWebRequest objects to communicate with the server.

The app ran fine in the emulator that comes with vs.net 2003, so i
made
an
msi of it and shared it for testing. The installer appeared to work
fine as
well, but upon running the program we see all sorts of strangeness...

* The input panel doesn't appear on the menu bar for the login form
(a
modal
dialog a la InputBox).
* MSN Messenger is the active form when the login form is closed.
Messenger
was not running when the app started.
* The tester has a keyboard installed, and managed to fill in the
login
form. Once he hit "ok", the main form popped up....but immediately,
a
message about an "unexpected error" appeared--IN THE INFO TEXTBOX.
No
dialog, no "details" button, none of that. The error appeared, the
main form
stayed for another half second or so, and then the app died.
* All this happens every time the app runs. I'd probably see more
strangeness if i could keep it running. :P

The testing PDA is an iPaq 5450 (PPC 2002, windows v3.0.11171 [build
11178])
with .net CF v1.0 SP2. The emulator appears to be running .net v1.0,
but the
windows version number is identical to the PDA's. Both machines have
plenty
of memory left.
 
Back
Top