 |
|
 |
Great tutorial, thanks!
To promote computer science in Africa !
|
|
|
|
 |
|
 |
Hello
I have a keyboard wedge barcode scanner plugged into my PC.
explorer.GetDevices(); is always returning null
anyone have an idea what's going on?
|
|
|
|
 |
|
 |
Hi,
I have attached the device and also now it is showing in the list. But whenever I am trying to open that device it is giving me exception and not opening the printer.
modified on Saturday, October 16, 2010 12:41 AM
|
|
|
|
 |
|
 |
jammmie999 i tried ur application and it works fine with ms scanner simulator now i want to use a actual scanner so please help me as to which scanner i should go for and how please help me and suggest a bar code reader that has service objects for pos.net
|
|
|
|
 |
|
|
 |
|
 |
Great coding method.
To the point
User vriendly.
|
|
|
|
 |
|
 |
Like your code it works great.
I just cant figure out how to open ans claim a single scanning device with out using a list box.
I know i can get the device information for one spicific scanner, but also having problims with that. (the type is "Scanner" but the logical names of all scanners is "" (string.null))
I need users to just use the scanner not to select them first.
Please help.
Thank u.
|
|
|
|
 |
|
 |
Sory for the question. Found the awnser. after a break.
Very simple and easy to understand.
Probably y did not find it sooner. (searching for somethin hard)
not using a list box...
Here is my code (The Form_Load screan)
private void Form1_Load(object sender, EventArgs e)
{
explorer = new PosExplorer(this);
scannerList = new ArrayList(explorer.GetDevices("Scanner"));
foreach (DeviceInfo di in scannerList)
{
if (di.Description == "USBHHScanner")
{
ActivateScanner (di);
}
}
}
If u have a simpler way of doing this.
Pleas feel free to send it my way. thanks.
|
|
|
|
 |
|
 |
hehe that is pretty basic stuff dude!
|
|
|
|
 |
|
 |
i downloaded the pos from the link given above but i feel there were a sew classes missing since while writing when i pressed dot the intellicence feature was not appearing and it is still givin loads of errors
void activeScanner_DataEvent(object sender, DataEventArgs e)
{
UpdateEventHistory(Data Event);
Here in the abouve statement i feel it should reconginse Data Event but it dosent and secondly i thought i 'g let you know m using visual studio 2008.....
it would help if you could reply asap.......
|
|
|
|
 |
|
 |
I downloaded and test this on a Windows 7 machine and the activeScanner_DataEvent failed because it is trying to update controls and not doing it on the UI thread. Had to update both the activeScanner_DataEvent and the UpdateEventHistory methods. Also using .NET 3.5 SP1 and VS.NET 2008. The below code fixes the issue.
void activeScanner_DataEvent(object sender, DataEventArgs e)
{
UpdateEventHistory("Data Event");
ASCIIEncoding encoder = new ASCIIEncoding();
try
{
string data = encoder.GetString(activeScanner.ScanDataLabel);
Action<string> updateScanDataLabelAction = new Action<string>(p => {txtScanDataLabel.Text = p;});
txtScanDataLabel.Invoke(updateScanDataLabelAction, data);
string dataType = activeScanner.ScanDataType.ToString();
Action<string> updateScanDataTypeLabelAction = new Action<string>(p => { txtScanDataType.Text = p; });
txtScanDataType.Invoke(updateScanDataTypeLabelAction, dataType);
activeScanner.DataEventEnabled = true;
}
catch (PosControlException)
{
UpdateEventHistory("DataEvent Operation Failed");
}
}
private void UpdateEventHistory(String newEvent)
{
if (txtEventHistory.InvokeRequired)
{
Action<string> updateEventHistoryAction = new Action<string>(p => { txtEventHistory.Text = p; });
txtEventHistory.Invoke(updateEventHistoryAction, newEvent);
}
else
{
txtEventHistory.Text = newEvent + System.Environment.NewLine + txtEventHistory.Text;
}
}
Not sure if this is a Win 7, .NET 3.5 issue or what. But its what I used to fix the problem.
Thanks again for the post. I will be trying this code out later on against an actual bar code reader device.
|
|
|
|
 |
|
 |
Hi,
I'm trying this test on Windows 7 and I can not get to run the event DataEvent Scanner to read a barcode.
I am using Windows 7, VS2008 and Metrologic Scanner for COM1.
Have you had to change something in windows that works for you (install some DLL or something)? The funny thing is that from other programs works perfectly using ActiveX controls.
A greeting.
|
|
|
|
 |
|
 |
Well I was running the code from the article using the emulator. I never did get around to using an actual device. I'd still like to do that. I have a Metrologic scanner as well, but mine is a USB scanner. A couple of things maybe you could try to look into would be to make sure the scanner is not configured to simple run as a keyboard wedge. My scanner out of the box was configured this way. I don't think the events as you would think if the scanner is configured as a keyboard wedge. Read your manual to figure out how to change this. I hope this helps. I'll try getting to this again with my device here in the next few days. I'll reply back my findings.
Cheers.
|
|
|
|
 |
|
 |
Thanks for respoder so soon.
The mode of the scanner should not be since it works perfectly in other programs that use ActiveX instead of POS for. NET, but I still do not make me work.
I'm pretty sure it's a configuration problem of Visual Studio 2008, or the fault of running the program on a Windows 7 x64. I have the same problem with all OPOS, the program is entirely correct, the devices are synchronized methods run well and correctly, can access their properties without any problem, but we do not get is that "jump" events.
Greetings.
|
|
|
|
 |
|
 |
I've rewritten the program.
If you want I can post the code
Regards
Filippo
|
|
|
|
 |
|
 |
Please post your code if you finished. Thanks a lot
Here I am, this is me. I come into this world to code....
|
|
|
|
 |
|
 |
I'm on holiday. I'll post the code on 1st september...
Regards
filippo
|
|
|
|
 |
|
 |
How I can attach my code at this article?
|
|
|
|
 |
|
 |
If you zip it and upload it to a file sharing site e.g. rapidshare, uploading etc. I will download, scan and attach it to the article.
Thanks
|
|
|
|
 |
|
 |
This is the link
http://rapidshare.com/files/273965946/GestiFe.zip.html
There is only a combobox added but you can delete it.
Bye
Filippo
|
|
|
|
 |
|
 |
Thanks, I have added this to the article now.
|
|
|
|
 |
|
 |
Hi Filipo
I tried to get the code in this link
http://rapidshare.com/files/273965946/GestiFe.zip.html
but it doesn't exist. Can you send your code, please?
Thank you
Carlos Cabrera
|
|
|
|
 |
|
 |
Use the link that is present in the article (not rapidshare) or send me your email.
Regards
Filippo
|
|
|
|
 |
|
 |
I got this error when I tried to activate the 3800g Linear Series Scanner.Can anyone help me?
|
|
|
|
 |
|
 |
I'm trying to do this in C/C++, but can't seem to get passed the error of declaring an abstract class.
Is it possible to simulate devices in C/C++?
Thanks
|
|
|
|
 |