Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RE: Symbol Scanner - No buffered scans on startup?

1 view
Skip to first unread message

Howard@discussions.microsoft.com Tom Howard

unread,
May 18, 2009, 10:41:03 AM5/18/09
to
Here is a little more background on what I am doing.

I wrote a windows service that runs automatically on system startup. This
service receives scanned data from a Symbol USB scanner in the data event
generated by the POS for .NET library.

The service object code for the Symbol scanner uses the HIDReader sample
class to comunicate with the scanner. Data events are successfully captured
and sent to my windows service application.

The issue that I have is that, if for some reason he windows service does
not start, and users scan data, I cannot retrieve the data from the scanner
when the service does start.

No other application has claimed the scanner device and is receiving the
data events so I do not know where the data on the scanner has gone when the
HidReader class opens the scanner and attempts to read from it.

My expectation was that when the HidReader class opens the file (scanner),
data would be sitting there waiting to be read. So far, in my testing, this
has not been the case.

Sylvester La Blanc MSFT

unread,
May 18, 2009, 10:49:53 PM5/18/09
to
In article <69F11555-E2F5-4F71...@microsoft.com>,

You may want to check what user context your service is running.

- Sylvester
--
This posting is provided "As Is" with no warranties, and confers no rights.
X-Face: 3bv|Grp$j"BCYpET|y@@/5=;j9@Zuc[XSbP7Ui8#`J0J|PX0c!m9=]McR9PPq
\TvMOAvJUes)hkN;<}cLH#}@F~*t`[>9@,;4`@OEs?BpPKrJ+x.E{1i.AEbJ6ul-~X/1
6Hqa0bJ4m]?L@j?dy.l_=|b[iZjr>!x:P_&p"[OI@^'^-U[^6FHdTI5~"Ak[Vp%?ba?/
CcQZS+nKY[D!H~08:[_F8^I{%c#yh8;#u7$m0^dZ3DOr=6=!*`"(z3%$HUBVFlfAn4H0
\<f:HYfWP:g<P:3gp?6d,ge~y

Tom Howard

unread,
May 19, 2009, 12:07:02 PM5/19/09
to
Sorry, that just went over my head. What I think I hear you saying is that:

1. My service is running under a user context, this user context is used,
once the scanner is claimed, to transfer data from the scanner via the
Handle/FileStream/Memory Buffer on the device in the HidReader class.

2. If scans occur when my service is not running, the Scanner device has
its own user context which holds the memory buffer of data.

3. When my service does start, it needs to connect via the same user
context the scanner device was using in order to access that memory buffer.

If I am understanding correctly above, how might I determine or set the user
context of the device?

If I am on the wrong track, could you point me in the right direction?

Thanks!
Tom

Sylvester La Blanc MSFT

unread,
May 28, 2009, 12:49:29 AM5/28/09
to
In article <3A5E9C96-8BFF-4085...@microsoft.com>,
Tom Howard <TomH...@discussions.microsoft.com> wrote:


You are the first person that I've heard who was attempting to interface
with a POS peripheral from within a service. If you are running a
service, you need to be aware that services will run under some user
context, such as system (for example). I'm thinking this may be related
to your problem (but not sure).

Given that you only encounter problems when you need to manually start
the service, I wonder if somehow it is starting under some other context
and that is causing a problem? At least that is something I would look
into if I was working on this. Sorry if I can not be of more help.
Good luck and let me know what you find.

-- Sylvester


--
This posting is provided "As Is" with no warranties, and confers no rights.

0 new messages