|
Thanx Dybs,
I had already tried this approach but it does not work under Windows Vista.
Actually, in Vista when you login as Administrator everything works fine. But with users other than Administrator it does not works. Vista creates different registry entries for othe Users.
I have found below solution :
I have used ManagementObjectCollection and ManagementObjectSearcher.
ManagementObjectCollection ManObjCollection;
ManagementObjectSearcher ManObjSearch;
ManObjSearch = new ManagementObjectSearcher("Select * from Win32_PnPEntity");
ManObjCollection = ManObjSearch.Get();
foreach (ManagementObject ManObj in ManObjCollection)
{
if (ManObj["Name"] == "Name You Are Looking For")
{
}
}
This has worked fine for me with XP and Vista, (Administrator and Non-Administrator) and it is fast also.
Hope this would help you further...
Regards,
-SIFAR.
|
|
|
|
|
Dear All,
How can I show the Windows Mobile circular waiting cursor from my form?
I'm sure it is very easy, but I've been looking for the solution form some time now without aany success.
Thanks in advance,
miguelji
|
|
|
|
|
I would try Cursor=Cursors.WaitCursor;
|
|
|
|
|
Tat was my first try, but in a Windows Mobile 6 device it doesn't work.
I'm probably doing something wrong, but it is so simple that I dont know what can be wrong.
miguelji
|
|
|
|
|
Yes, I think the cursor.waitcursor method may work in your scenario. Windows Mobile by default should display the waiting cursor for you. Is there something specific you are doing inside of your custom app? You didn't leave a lot of details.
|
|
|
|
|
Yes you are right, I was not leaving any detail.
I need to show the waiting cursor while my program performs a series of time consuming tasks. I've isolated the problem and created a WM6 (CF 3.5) application with a single form and a single button in it. Then I write the following code for the click event of the button (I use VB, but this would be the C# equivalent):
----------------------------------------------
Cursor c = default(Cursor);
c = Cursors.WaitCursor;
this.Refresh();
int I = 0;
int J = 0;
for (I = 1; I <= 10000000; I++) {
J = I * 3;
}
c = Cursors.Default;
this.Refresh();
----------------------------------------------
I run the programa, click the button and nothing happens, no cursor is displayed.
What Am I doing wrong here?
Thanks,
miguelji
|
|
|
|
|
Simply try this
Cursor.Current = Cursors.WaitCursor;
Cursor.Show();
and
Cursor.Current = Cursors.Default;
Cursor.Hide();
|
|
|
|
|
Thank you doananhtai!
It works perfect. It was easy, but thank you for being the one to tell how to do it.
Cheers,
miguelji
|
|
|
|
|
Dear All,
I have a critical application for which the performance has to be monitored.
I used the performance monitor in Windows 2003 server to log the data.
I have logged the counters of the Page file bytes and % processor time of the process / the service instance which has to be monitored along with the Processor % Processor time.
When I was analyzing the log I hae found a strange issue, the Processors % Processor time is 88 % but the instances % Processor time is 175 %.
Can any one tell me how this happens and how it is calculated?
Thanks a lot in advance.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Do you have a dual core system? If so the second number appears to be the percentage of time consumed relative to the capacity of a single core.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
M. J. Jaya Chitra wrote: When I was analyzing the log I hae found a strange issue, the Processors % Processor time is 88 % but the instances % Processor time is 175 %
88 percent of 200 == 176
Sounds like you have two processers and the process being performance monitored is multi-threaded.
Best Wishes,
-David Delaune
|
|
|
|
|
Dear Friends,
Yes, I am having the dual core processor.
Both of your post helped me a lot.
Thank you a lot for the timely reply and help.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Hi,
When using DeviceIoControl with METHOD_BUFFERED, will the buffer that windows allocate in kernel (the one that is the copy of user space), would it be taken from the non paged pool ?
I was looking for more specific documentation on the subject and did not find something explicit.
Thanks,
Shay
|
|
|
|
|
Hi Shay,
Yes, METHOD_BUFFERED will allocate the buffer from non-paged pool in the kernel address space. You can take a look at the diagram in the article Using Buffered I/O[^] to see an overview of the buffered I/O transfer method.
Best Wishes,
-David Delaune
|
|
|
|
|
Thanks Dave, I ended up finding this link as well.
Shay
|
|
|
|
|
Hi everybody,
I am planning a PIN PAD and to get response from the device needs to send the command CE, does anyone know how can I do?
Thanks
|
|
|
|
|
|
Thanks for responding.
Try to explain better, I have a PIN PAD to achieve communication with the device, I will send a command more or less well <stx> CE0 <ext> <lrc>, the calculation of the LRC is on each byte without taking into account the first , ie C XOR E XOR 0 XOR EXT and sends me a number, however when sending information to the CE device I have to send as a command, not byte by byte like I'm doing now, but do not like
Thanks
|
|
|
|
|
OK, I misunderstood, I was thinking of more basic electronic stuff.
you did not and still don't tell the make and model, the kind of interface, etc. so how could anyone offer real help?
if the interface is serial (RS232C) you should use the SerialPort class, and transmit/receive byte arrays. if the interface is something else (e.g. USB) you would need the manufacturer's driver.
As far as the commands and encryption go, your first reference should also be the manufacturer's documentation.
If in the end you have a specific question or problem, show some code, and someone will be able to help you.
|
|
|
|
|
If you're right about that, is something more at the programming level. Well if necessary, the manufacturer's documentation does not offer me much, except what I have outlined here. I am communicating by serial interface. Hopefully someone can help me. When communication was achieved by sending a byte array, however, to verify the PIN PAD communication do not operate if you do not send as a command EC is, I sent
02 67 69 48 03 <lrc>
STX C E 0 ETX <lrc>
06 And I get a response (ACK) on the device but not recognized as an instruction, told me I should send a command such as CE, I suppose that as a single byte, but not how to do
|
|
|
|
|
you still are keeping everything a secret except that you now told the world it is using a serial port.
What is the make and model?
what documentation do you have?
do you have their sample code?
do you have examples of messages?
where did you get those STX, ETX, ACK inspiration?
does it say anything about ENQ?
does it say anything about hardware handshake lines?
etc etc.
and why do you send CE and call it an EC command?????
|
|
|
|
|
Sorry luc
The information that I had not previously requested, but this time I can answer your questions.
1- It is a PINpas Secura (http://www.secure-retail.co.uk/products/index.php?sg=&manufacturer=all§ion=Terminals&range=Chip% 20and% 20PIN & pid = 1146)
2- The documentation I have is a small reference manual says that only the commands to be sent to the device but do not specify mas.Solo say "you have to send <stx> <ce0> <ext> <lrc>" They do not provide any other info.
3- The example code is
Public Sub SendData(ByRef strCadena As String, ByVal strType As String, ByVal LRC As String, ByVal strCaracterInicial As String, ByVal strcaracterFinal As String, Optional ByRef strComando As String = "")
Dim strNuevaCadena As String = "", nCount As Integer = 0
Try
If comm.OpenPort = True Then
comm.ClosePort()
comm.OpenPort()
End If
Catch
MsgBox("Error " & Err.Description, MsgBoxStyle.Critical + MsgBoxStyle.Exclamation, "Open Port")
comm.ClosePort()
comm = Nothing
End Try
Try
comm.Message = strCadena
If strType = "HEX" Then
comm.CurrentTransmissionType = clscommanager.TransmissionType.Hex
Else
comm.CurrentTransmissionType = clscommanager.TransmissionType.Text
End If
For nCount = 1 To Len(strCadena)
strNuevaCadena = strNuevaCadena & Asc(Mid(strCadena, nCount, 1))
Next
comm.Type = clscommanager.MessageType.Normal
comm.WriteData(strCaracterInicial, Asc(strComando), strNuevaCadena, strcaracterFinal, LRC)
Catch
MsgBox("Error " & Err.Description , MsgBoxStyle.Critical + MsgBoxStyle.Exclamation, "Open Port")
End Try
End Sub
Where strCadena ="CE1", strType = "HEX", LRC = Result LRC, strCaracterInicial = "STX", strcaracterFinal = "EXT", strComando = ????
4- STX EXT values etc. The got a page with ASCII values (http://i-logic.com/serial/ascii.htm)
5- What you mentioned is the following ENQ:
"The master must send an ENQ character (0x05) to be answered with an ACK character (0x06) with the PIN pad. This procedure indicates whether the PIN pad is ready to accept a request from the master device.
If no ACK is received from the PIN pad within the time-out period (default = 15 seconds), the master must send poll before sending the command.
The master must repeat the process of sending a pennyroyal ENQ command until an ACK is received within the period of time-out"
6- does it say anything about hardware handshake lines. No
7- When I started to program the service provider asaesorando me and I sent copies of the bytes being sent to the port. When you send in the final chain <stx> <ce0> <etx> <lrc> I said, "The calculation of the LRC's fine, "The problem is not sending these as CE0 or CE1 command"
String that I send is : 02 67 69 48 03 45. giH.E
I hope this helps you better ented
|
|
|
|
|
Hi,
this will not go easy; there are many dark points left.
1.
what is your programming language (VB? VB.NET? ...), and your development tool Visual Studio 6? 2003? 2005? 2008? ...)
2.
are you receiving anything at all through the serial port?
e.g. when sending an ENQ do you get an ACK?
when hitting some keys on the pin pad do you get anything?
if not: either you are not connected, connected to the wrong port, have bad port parameters, or some general programming mistake
3.
do you have the "small reference manual" in electronic form? if so, can you provide a URL or mail it to me? or scan it and mail it?
I wouldn't mind if it were in another language (I expect it is in Spanish)
4.
the command character will be crucial (the one in between STX and EC0), and only some manual can tell what it should be.
5.
I have strong doubts about the checksum (LRC). For one, if it could have any value, it could also interfere with the protocol (e.g. it could happen to be equal to an STX). Also your example "02 67 69 48 03 45. giH.E" seems wrong, not only for the giH.E but also 45 would not be the LRC of "67 69 48 03"
6.
If you have some code that already communicates successfully, I would like to see it.
BTW: when publishing code on CodeProject, please use PRE tags or use the "code block" button below the editor window, it preserves formatting.
|
|
|
|
|
Hi Luc648011
1- I am programming in Visual Studio 2008.
2- If you send even if you mention the chain sends me an ACK but I do not do anything
3- I hope you can provide your email account to be able to send you what I have so far.
|
|
|
|
|
Hi,
I did receive your rar file, and had a very quick browse of the Word document
(Especificaciones Dispositivo lector de tarjetas chip v1.107 2.doc) which seems like a rather complete programmer's manual.
On page 15 they explain the CE command, it looks like:
- 1 byte STX
- 3 characters CE0/CE1/.../CE4
- 2 bytes
- a number of data bytes
- 1 byte ETX
- 1 byte LRC
So there is no byte between STX and 'C' but there are date bytes between "CEx" and ETX.
I haven't looked at your code so far.
I suggest you begin with the simplest communication message, I would choose the test command on page 12; it consists of:
- 1 byte <si>
- 2 characters "11"
- 1 byte <so>
- 1 byte LRC
The nice thing is it is a fixed command, there is no variable data; and when successful it will tell you:
- the connection is present;
- your basic serial port settings and code are fine;
- your LRC calculation is correct (which is not the case right now as I recall from an earlier message)
Do this before you try anything more complex!
If you need more help, I might start and look at the code.
I trust you have read most of the manual. It really is much more than "a small reference manual", I expect it holds all information you need.
|
|
|
|
|