|
Barcode scanners generally come with an API, or mimic keyboard entry depending on the make/model. There is no way whatsoever for anyone to answer your question without knowing which type of scanner you are using.
KIDYA wrote: Give me any useful link or code for same.
Even if you had worded that sentence politely (ie, with the addition of the word please) nobody is going to help you unless you help yourself.
|
|
|
|
|
Then what is my work? i m new wid this.is there any operations want to do wid API? or it will installed automatically when set up of scanner install.
|
|
|
|
|
That sentence makes no sense. "wid" is not a word in the English language (Although freakishly enough its my wife's pet name for her dad dont ask!)
|
|
|
|
|
Apparently, wid is the new with. Just like his name is the new word for fail.
|
|
|
|
|
Set the focus to your text box and pull the trigger.
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: pull the trigger.
stick'em up
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
hi,
I want to ask how to convert this C struct into C#.net
typedef struct _MT_EVENT {
#if _WIN32
LARGE_INTEGER TimeStamp; // In FILETIME format
#elif LINUX
struct timeval TimeStamp; // In gettimeofday() format
#endif
ULONG UserStatus; // Not used by API
ULONG EventCode; // Event Code
ULONG SubReason; // Event sub-reason
ULONG XtraInfo; // Extra information, e.g. termination
ULONG FuncCode; // Function active when this event occurred
USHORT Board; // Board ID
USHORT Channel; // Global Channel ID (GCI)
PVOID ptrBuffer; // Related play/record buffer pointer
ULONG DataLength; // Byte length of data accessed (played/recorded)
PVOID ptrXtraBuffer; // Pointer to xtra buffer
ULONG XtraBufferLength; // Length of buffer pointed by ptrXtraBuffer
ULONG XtraDataLength; // Length of data in buffer pointed by ptrXtraBuffer
ULONG EventFlag; // Falgs of the following:
// bit 0x00000001: 1 - Appl created the event
// 0 - NTi DLL created the event
// bit 0x00000002: 1 - Appl allocated ptrtraBuffer
// 0 - NTi DLL allocated ptrXtraBuffer
} MT_EVENT, *PMT_EVENT;
|
|
|
|
|
Check out the code MS provides for the Windows Mobile Gps, http://msdn.microsoft.com/en-us/library/ms881362.aspx[^] (Sample code comes with the SDK)
It contains many C structs written in C#, fairly cool. (Although, the sample like all MS samples doesn't work out of the box)
|
|
|
|
|
I'm not so hot on all that interop stuff and its a guess, but you could try this:
[StructLayout(LayoutKind.Sequential)]
public struct _MT_EVENT
{
public long TimeStamp;
public ulong UserStatus;
public ulong EventCode;
public ulong SubReason;
public ulong XtraInfo;
public ulong FuncCode;
public ushort Board;
public ushort Channel;
public IntPtr ptrBuffer;
public ulong DataLength;
public IntPtr ptrXtraBuffer;
public ulong XtraBufferLength;
public ulong XtraDataLength;
public ulong EventFlag;
}
Regards,
Rob Philpott.
|
|
|
|
|
size warning: in.NET long/ulong are 64-bit integers, in most other languages when targettingt a 32-bit CPU they just take 32-bit.
http://www.pinvoke.net[^] holds lots of useful interop stuff, however it also contains some mistakes, frequently passing a pointer as int (should be IntPtr).
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
That is the primary reason I encourage (require) programmers on my teams not to use int and long in C# and instead require Int32 and Int64. The same issue comes up a lot in database programming. I am absolutely sick and tired of seeing cast errors in code because a programmer doesn't know what type they are using.
|
|
|
|
|
|
Hi,
I have a string with value "111733394601234567094987654321" . Now i want to divide this with 636. I convert it to double , then im getting 1.1173339460123456E+29 . but these both values are differnt finally im
getting wrong output. can anyone help me.....
Thanks
Prathap
|
|
|
|
|
There is no way you can do that with doubles. Since the value is too big even for a 64 bit integer, you should use some 128-bit integer class. See for example this[^] or Google for some more.
2+2=5 for very large amounts of 2
(always loved that one hehe!)
|
|
|
|
|
The latest .NET 4.0 (and Visual Studio 2010) is in beta and offers a BitInteger class which would easily take care of your big integer division, yielding accurate quotient and remainder values.
There also have been some articles on home-brew BigInteger classes here on CP (with varying functionality and quality).
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi, my database has a column called 'course'. I have a value "Game & Entertainment Technology"
when i extract the value using
acc.Course = reader.GetValue(4).ToString();<br />
lblCourse.Text += " " + acc.Course.ToString();
the value becomes Game Entertainment Technology.. the & disappear
|
|
|
|
|
That's because & is used to underline a letter for a shortcut. You need to double it to &&.
acc.Course = reader.GetValue(4).ToString();
lblCourse.Text += " " + acc.Course.ToString().Replace("&", "&&");
Regards,
Rob Philpott.
|
|
|
|
|
Actually, presuming reader is a SqlDataReader and acc.Course is a string you can shorten this to:
acc.Course = reader.GetString(4);
lblCourse.Text += " " + acc.Course.Replace("&", "&&");
Regards,
Rob Philpott.
|
|
|
|
|
thanks alot!
1 more question. My first screen is a login screen. Therefore i have a username and password textbox.
private void btnLogin_Click_1(object sender, EventArgs e)<br />
{<br />
bool validate = db.authenticate(tbxUsername.Text, tbxPassword.Text);<br />
if (!validate)<br />
{<br />
MessageBox.Show("Invalid Credentials");<br />
}<br />
else<br />
{<br />
frmMain main = new frmMain(tbxUsername.Text);<br />
<br />
main.Show();<br />
this.Hide();<br />
<br />
}<br />
}
Is it possible to close the login form instead of hiding it? I do a this.close() but after i login everything close.
Also, my db.authenticate is not case sensitive. The password in the database is 'test'. However when i entered 'TEST', it works too.
|
|
|
|
|
If the login form is the first one created and called from Program.cs, the application classes it as the 'Main' form of the application. When the main form closes, the application closes.
There are loads of examples of using a login form on the web, have a quick google to see how to do it.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Okay. Noted. Thanks
What bout make the password and username case sensitive?
|
|
|
|
|
You stated that db.authenticate was not case sensitive. I can not find any reference to an authenticate method for any database related classes, so I assume that it is one you have written yourself.
If that is so, take a look at this[^].
I not, I am unable to help.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
thanks. i found the solution.
inside phpmyadmin, i change the collation to latin1_general_cs.
cs refers to case sensitive
|
|
|
|
|
Certainly you'd want to close the login screen when you're finished with it. There are a few ways to do this. Also, you don't want to do a main.Show() in the login screen - you lose reuse and abstraction if you do that by tightly coupling the login and main screen.
To open the main screen after the login either call ShowDialog() on the login form from the main form's on load event or you can change your main() function to look like this:
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new LoginForm());
Application.Run(new MainForm());
}
Regards,
Rob Philpott.
|
|
|
|
|
Ampersand "&" is used as a special character in Windows Forms controls: it will cause the next character to be underlined. You can solve your problem by replacing each ampersand with a double ampersand.
Try something like:
lblCourse.Text += " " + acc.Course.ToString().Replace("&", "&&");
2+2=5 for very large amounts of 2
(always loved that one hehe!)
|
|
|
|