PC Review


Reply
Thread Tools Rate Thread

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

 
 
=?Utf-8?B?SSBIQVRFIFBEQXM=?=
Guest
Posts: n/a
 
      28th Dec 2004
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.
 
Reply With Quote
 
 
 
 
Dan Bass
Guest
Posts: n/a
 
      31st Dec 2004
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" <I HATE (E-Mail Removed)> wrote in message
news:6DF4A1AF-BE8C-4E69-BB6B-(E-Mail Removed)...
> 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.



 
Reply With Quote
 
Chris Tacke, eMVP
Guest
Posts: n/a
 
      1st Jan 2005
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.

--
<ctacke/>
www.OpenNETCF.org
Your CF searches start and end here


"I HATE PDAs" <I HATE (E-Mail Removed)> wrote in message
news:6DF4A1AF-BE8C-4E69-BB6B-(E-Mail Removed)...
> 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.



 
Reply With Quote
 
=?Utf-8?B?SSBIQVRFIFBEQXM=?=
Guest
Posts: n/a
 
      4th Jan 2005
"Dan Bass" 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?

/
 
Reply With Quote
 
Sergey Bogdanov
Guest
Posts: n/a
 
      4th Jan 2005
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:
> "Dan Bass" 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?
>
> /

 
Reply With Quote
 
Daniel Moth
Guest
Posts: n/a
 
      4th Jan 2005
> 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
news:(E-Mail Removed)...
> 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" <I HATE (E-Mail Removed)> wrote in message
> news:6DF4A1AF-BE8C-4E69-BB6B-(E-Mail Removed)...
>> 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.

>
>



 
Reply With Quote
 
Daniel Moth
Guest
Posts: n/a
 
      4th Jan 2005
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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:
>> "Dan Bass" 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?
>>
>> /



 
Reply With Quote
 
Sergey Bogdanov
Guest
Posts: n/a
 
      4th Jan 2005
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 Moth wrote:
> 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" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>
>>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:
>>
>>>"Dan Bass" 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?
>>>
>>>/

>
>
>

 
Reply With Quote
 
I HATE PDAs
Guest
Posts: n/a
 
      5th Jan 2005
"Sergey Bogdanov" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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

/


 
Reply With Quote
 
Daniel Moth
Guest
Posts: n/a
 
      5th Jan 2005
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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 Moth wrote:
>> 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" <(E-Mail Removed)> wrote in message
>> news:%(E-Mail Removed)...
>>
>>>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:
>>>
>>>>"Dan Bass" 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?
>>>>
>>>>/

>>
>>




 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Windows Setup experienced an unexpected error - Error Code: 0x0" =?Utf-8?B?QnJhZA==?= Windows Vista Installation 0 11th Mar 2007 02:47 AM
"an unexpected error occurred." when attempting to change or view properties Ben Nguyen Windows XP Networking 1 1st Nov 2004 12:28 PM
Re: REPOST: Suppressing the default "Unexpected Error" dialog OR global error handler - CF 2.0 Daniel Moth Microsoft Dot NET Compact Framework 0 1st Aug 2004 08:40 PM
error receiving information from fixed IP address "The underlying connection was closed: An unexpected error occurred on a receive." Angel Microsoft C# .NET 1 19th Jan 2004 04:58 AM
Suppressing the default "Unexpected Error" dialog OR global error handler Daniel Moth Microsoft Dot NET Compact Framework 0 7th Oct 2003 04:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:23 PM.