By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,301 Members | 3,575 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,301 IT Pros & Developers. It's quick & easy.

Which is the sequence of events when using ShowDialog()?

P: n/a
Hi all,

I'm having troubles with a Symbol 9000 device (Compact Framework v 1.1) when
activating the barcode scanner from a window. The problem is related to the
Activated event of the form which carries the task of the initializing the
scanner. It looks like this event is not called after the creation of one of
the forms. Let me describe shortly the sequence of form creation. The app
first call a browsing form by using ShowDialog(). This browsing form (modal
dialog) calls a data input form that uses the scanner device using
ShowDialog(). It works as expected. On the Activated event it captures the
scanning device and on Deactivate releases it. This forms is also a modal
dialog. From this data input I call a third data input form also by using
ShowDialog(). Note it is the third on the "stack" of called modal dialogs.
The Deactivate event is called for the second form and the scanner is
released, but the Activated event is not called for this third form then the
scanner is not activated. To get the Activated event called I should make a
trick: The three modal dialogs are represented on the taskbar as buttons. I
can click the button of the second form. It is displayed but is blocked for
input. But in this click the Deactivate event is called for the third form
and the Activated is called for the second. Then I click the button on the
taskbar for the third form and voila! the Activated event is called for the
first time for the third form, resulting in the scanner device being
activated. I should note that the handlers for these events are registered
in the Load event handler. The Load event handler is registered on
InitializeComponent as normally it is created from the Visual Studio 2005. I
fear the Activated event is called before the Load when the handler is not
registered yet.
What can be wrong? Which is the sequence of events when using ShowDialog()?

Any hint is welcomed
Thanks in advance
Sammy

Aug 14 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

In the dev kit of symbol you have a working sample of a scannining win app.
you can use it.

You just have to be careful with creating only one instance of the control.

I don't remember clearly now how I did it (I do not have the code with me)
but it was not that difficult.

You do not need to have a textbox focused.
Finally be careful with modal dialogs , if you get a orphan window you may
get into problem.

So in short, see the sample in the docs, it works perfectly !!!

--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"SammyBar" <sa******@gmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Hi all,

I'm having troubles with a Symbol 9000 device (Compact Framework v 1.1)
when activating the barcode scanner from a window. The problem is related
to the Activated event of the form which carries the task of the
initializing the scanner. It looks like this event is not called after the
creation of one of the forms. Let me describe shortly the sequence of form
creation. The app first call a browsing form by using ShowDialog(). This
browsing form (modal dialog) calls a data input form that uses the scanner
device using ShowDialog(). It works as expected. On the Activated event it
captures the scanning device and on Deactivate releases it. This forms is
also a modal dialog. From this data input I call a third data input form
also by using ShowDialog(). Note it is the third on the "stack" of called
modal dialogs. The Deactivate event is called for the second form and the
scanner is released, but the Activated event is not called for this third
form then the scanner is not activated. To get the Activated event called
I should make a trick: The three modal dialogs are represented on the
taskbar as buttons. I can click the button of the second form. It is
displayed but is blocked for input. But in this click the Deactivate event
is called for the third form and the Activated is called for the second.
Then I click the button on the taskbar for the third form and voila! the
Activated event is called for the first time for the third form, resulting
in the scanner device being activated. I should note that the handlers for
these events are registered in the Load event handler. The Load event
handler is registered on InitializeComponent as normally it is created
from the Visual Studio 2005. I fear the Activated event is called before
the Load when the handler is not registered yet.
What can be wrong? Which is the sequence of events when using
ShowDialog()?

Any hint is welcomed
Thanks in advance
Sammy

Aug 14 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.