|
Thanks for that article,
Is TWAIN for just image scanning? what about a bar code USB scanner? is that the same?
|
|
|
|
|
Yes, TWAIN is for image acquisition from imaging devices like scanners and digital cameras.
A bar code scanner, on the other hand, is not an imaging device. They could require one of many interfaces. Most USB bar code scanners emulate keyboard input. A simple way to test this, if the bar code scanner is set up, is to open Notepad, focus in the text area, and scan a bar code--like off a box of food or a book.
If, by "scanner" earlier, you meant a bar code scanner, and it supports a virtual COM port, then you can, in fact, use the SerialPort class to connect to that virtual COM port and translate that data as needed. I used SoftCom32 when I first started with a serial (RS232) bar code scanner; it's a tray app that does exactly that--monitors the COM port for data, then emulates keystrokes. I've since replaced it with a sloppy little number I wrote in C# to interface directly to my app, so I don't get stray scans.
--
I've killed again, haven't I?
|
|
|
|
|
I have tried to use the SerialPort class to connect the barcode scanner's virtual COM port, i can detect the scanner's COM port but i failed to read the input in my program. When i try to scan the DataReceived event is not triggered but i can read the input into the HyperTerminal in windows, Any idea how to do read the input of the barcode scanner in vb.net using that class? or is there any alternatives besides that? Thanks
|
|
|
|
|
I don't see any reason why VB wouldn't let you scan bar codes if C# will.
You can post your port opening code so we can take a look at it.
There are a couple simple things to check:
- Make sure your
ReceivedBytesThreshold isn't set to some ungodly high number (should default to 1) - Make sure you call
Open() after you create the port
If it will help, I can post my C# class code this evening when I get back to that computer, so you can see the way I did it. I took a threaded byte-at-a-time approach because the DataReceived events I got resulted in fragmented scans (e.g. scanning "1234567890" got broken up into two events, "123456" and "7890") and I was scanning variable-length bar codes, so I couldn't just set it to fire DataReceived after n bytes.
--
I've killed again, haven't I?
|
|
|
|
|
This is how I open a com port
<br />
With serialPort<br />
.ReceivedBytesThreshold = 1<br />
.PortName = "COM3"<br />
.BaudRate = 9600<br />
.Parity = IO.Ports.Parity.None<br />
.DataBits = 8<br />
.StopBits = IO.Ports.StopBits.One<br />
End With<br />
serialPort.Open()<br />
and detect my com port using
For i As Integer = 0 To My.Computer.Ports.SerialPortNames.Count - 1<br />
combobox.Items.Add(My.Computer.Ports.SerialPortNames(i)) <br />
Next
after i open the COM port, i try to scan in some input won't trigger DataReceived events, anything that i have done wrongly? or anything i should set?
|
|
|
|
|
for my data received events goes this way
<br />
Private Sub serialPort_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles serialPort.DataReceived<br />
Me.Invoke(New EventHandler(AddressOf DoUpdate))<br />
End Sub<br />
<br />
Private Sub DoUpdate(ByVal s As Object, ByVal e As EventArgs)<br />
txtDataReceived.Text = txtDataReceived.Text + serialPort.ReadExisting()<br />
End Sub<br />
anything i have done wrongly? please advice... Thanks
|
|
|
|
|
Hey, i got it worked, i just set the RtsEnable to true then it worked
serialPort.RtsEnable = True
Thanks for all your support
|
|
|
|
|
Congratulations!
Glad to be of (little) help.
It would have been ages before I would check the handshaking; my old serial bar code scanner works with the default of none.
--
I've killed again, haven't I?
|
|
|
|
|
Hi all,
Hope someone who's had experience releasing commercial software/shareware can help... I have a VB.Net 1.1 app that automates many Photoshop functions to allow people to process whole folders of images into various formats while adding borders, dropshadows, doing conversions to B&W, etc. (It does waaaaay more than that but that's not the point here!)
Anwyay, I now want to sell this app on various shareware sites and hope to ask US$19.95 (or thereabouts) but I want to allow a user to download it and either use it for a trial period then stop or else disable certain functionality (like only allowing a max of 5 of the resulting images to be saved etc) until they download and pay for the licensed version. I also need to protect the software from disassembly/reverse engineering and also want do some sort of install/uninstall package.
I'm quite an experienced .Net developer but I've never had to do any of the above stuff for a commercial product - anyone know of any good resources to tell where to get started and best practices, etc?
TIA for any help/suggestions...
Mike
-- modified at 0:08 Monday 29th May, 2006
|
|
|
|
|
Does no-one have any input on this? Surely there must be a few shareware authors out there that could get me started with a few suggestion or recommendations?
|
|
|
|
|
http://www.siliconrealms.com/[^]
Well worth the money.
----------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
|
In my app i've to add a custom simple string property to columns collection such as:
datagridview1.columns(0).myproperty = "mystring"
i'm using vb2005
any suggestion?
|
|
|
|
|
Which library should you use for editing, playing ect. media files in Windows Vista?
Is DirectShow discontinued in DirectX10?
Will .NET 2.0 be included in Win Vista?
Programming is like Mathematics… you take ONE step at the time!
|
|
|
|
|
Friends!
I've two managed executables in my machine both target the similar version of CLR. I run the first application, the CLR gets loaded and runs my application. Now first application is running and at the same time i launch the second application.
As such whether the new copy of CLR gets loaded OR CLR is loaded only once and previous copy is resued ?
Imtiaz
|
|
|
|
|
I believe that's not going to be true for never versions of the CLR but the current version of .NET Runtime implemented as the InProc COM server.
That means that each managed executable creates a process and CLR loaded into this version.
That effectively means that new copy of CRL created for each copy of application.
Best regards,
-----------
Igor Sukhovhttp://sukhov.net
|
|
|
|
|
Dear All,
Please send me code snippet, tutorial or anythings which discribe how to use microsoft reporting service technology to generate reports within vb.net....? Thanks before.
|
|
|
|
|
|
Hi All,
I am building VB.NET web form application which access Web Service. I am wondering why the VB.NET send two packets to request the to the web service.
First packet:
POST /webservice/webservice1.asmx HTTP/1.1
SOAPAction: "http://webservice1/insUserName"
Content-length: xxx
Expect: 100-continue
Host: 192.168.1.1
Response from the web service:
HTTP/1.1 100 Continue
Date: ...
Second packet:
<xml version="1.0" encoding="utf-8">
Response from the web service:
HTTP/1.1 200 OK
...
I am wondering if there is a way that this packet can be just one packet,
such as:
POST /webservice/webservice1.asmx HTTP/1.1
SOAPAction: "http://webservice1/insUserName"
Content-length: xxx
Expect: 100-continue
Host: 192.168.1.1
<xml version="1.0" encoding="utf-8">
I am using VS 2003 with .NET 1.1
Thanks and best regards,
Riwan
|
|
|
|
|
I am trying to implement double buffering in a form, and I am getting a crash. I have a fix for the crash but I don't know if it's "correct".
To enable double buffering, I call this function from the form's constructor:
System::Void enable_double_buffering()
{
using System::Windows::Forms::ControlStyles;
SetStyle(static_cast<ControlStyles>(ControlStyles::DoubleBuffer |
ControlStyles::UserPaint |
ControlStyles::AllPaintingInWmPaint),
true);
UpdateStyles();
}
My Paint handler looks like this:
System::Void PlotDisplayWindow_Paint(System::Object* , System::Windows::Forms::PaintEventArgs* e)
{
using System::Drawing::Graphics;
Graphics* g = e->Graphics;
g->Dispose();
}
If I do not enable double buffering, then it works fine, but with flickering. With double buffering, I get the following exception:
************** Exception Text **************
System.ArgumentException: Invalid parameter used.
at System.Drawing.Graphics.EndContainer(GraphicsContainer container)
at System.Windows.Forms.DibGraphicsBufferManager.ReleaseBuffer(GraphicsBuffer buffer)
at System.Windows.Forms.GraphicsBuffer.Dispose()
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
If I comment out the g->Dispose(); line in the Paint handler, then I do not get the crash. Is it correct/acceptable not to dispose of the Graphics object after painting?
--
Marcus Kwok
|
|
|
|
|
ricecake wrote: If I comment out the g->Dispose(); line in the Paint handler, then I do not get the crash. Is it correct/acceptable not to dispose of the Graphics object after painting?
General rule is you should not be calling Dispose on objects that you didnt create
|
|
|
|
|
leppie wrote: General rule is you should not be calling Dispose on objects that you didnt create
Yeah, looking back on it I think the call to Dispose() was an artifact of when I tried to use threads and CreateGraphics() .
--
Marcus Kwok
|
|
|
|
|
Hi all,
Is there a possibility to detect in code (console application) if IIS supports asp.net? (only detect, not fix the problem)
There is a case when you install first the .net framework and after that install the IIS server, so the .net is there but IIS does not know that and .aspx is not working.
Does anyone heave a code sample that can do this detection?
Thanks,
Dinu
|
|
|
|
|
Hi.
I'm coding a c++ dll with visual studio 2005 and in my project configuration properties, the Common Language Runtime Support is set to "no".
What I want is to get executables which may run in every windows machine without the need of the .NET framework, and I was wondering if I'd need another IDE to do that.
Also I'm having problems mixing up a VB 6 program which uses a c++ dll compiled with vs2005. When I run the vb executable, it holds in the process list once it's close. Nevertheless, if I compile the same VB code with vs2005 and use it with the same dll, it all works like a charm.
If you don't know the answer, clues and tips are also welcome.
Thanks in advance.
|
|
|
|
|
I don't know about VS 2005, but in 2003, there are project types in the C++ folder for ATL, MFC and Win32. Pick one of those and your application won't depend on the .NET runtime. Programmer beware: just about anything fun needs at least one external DLL linked in, and you need to ensure that those libraries are on the target client yourself. MFC requires a runtime DLL, and I'd guess ATL does too (not sure, though). If you're trying to avoid dependencies, write pure Win32, and refer heavily to Petzold.
As for the VB6/C++ project you have, if it's not unloading itself it's highly likely that your C++ DLL is leaving a thread running. Look through your C++ code for anything that's creating threads or any dependencies that may be (external libraries often do this for polling, async I/O, etc.). Make sure they're giving back the threads when the message loop for the application dies.
Stephan
|
|
|
|