473,396 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

smartcard

Hi everyone
Just a quick question! Everytime i run the SCardConnect Command
SCARD_E_INVALID_PARAMETER is returned and i have absolutely no idea why!
I have a VB6 program that works perfectly, but when i try and implement the
same in VB.NET, I get the SCARD_E_INVALID_PARAMETER error.
I was just wondering if anyone could help? when i debug the program
hContext in VB6 = 0 however in VB.NET it = -855572479 or -855572480. Which
then produces a return code of HEX - 80100004 (SCARD_E_INVALID_PARAMETER)
The code i am using is:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim defaultReader As String
defaultReader = ComboBox1.Text
Protocol = clsPCSC.GetProtocol
ReturnCode = clsPCSC.winSCard.SCardConnect _
( _
hContext, _
defaultReader, _
clsPCSC.SCARD_SHARE_EXCLUSIVE, _
clsPCSC.SCARD_PROTOCOL_T0, _
hCard, _
Protocol _
)
If ReturnCode <> clsPCSC.SCARD_S_SUCCESS Then
MessageBox.Show( _
"An Error Occurred when connecting to the smarcard" _
& ControlChars.CrLf & "Error Number: " & Hex(ReturnCode), _
"Error!", MessageBoxButtons.OK, MessageBoxIcon.Warning, _
MessageBoxDefaultButton.Button1,
MessageBoxOptions.DefaultDesktopOnly)
Else
List1.Items.Add("Connection OK")
End If
End Sub
HOPEFULLY someone can help
Thanks in advance,

Nov 21 '05 #1
5 7552
Hi,

Maybe this will help
http://www.aspfree.com/index.php?opt...k=view&id=2108

Ken
----------------
<Windy> wrote in message news:eA**************@TK2MSFTNGP12.phx.gbl...
Hi everyone
Just a quick question! Everytime i run the SCardConnect Command
SCARD_E_INVALID_PARAMETER is returned and i have absolutely no idea why!
I have a VB6 program that works perfectly, but when i try and implement the
same in VB.NET, I get the SCARD_E_INVALID_PARAMETER error.
I was just wondering if anyone could help? when i debug the program
hContext in VB6 = 0 however in VB.NET it = -855572479 or -855572480. Which
then produces a return code of HEX - 80100004 (SCARD_E_INVALID_PARAMETER)
The code i am using is:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim defaultReader As String
defaultReader = ComboBox1.Text
Protocol = clsPCSC.GetProtocol
ReturnCode = clsPCSC.winSCard.SCardConnect _
( _
hContext, _
defaultReader, _
clsPCSC.SCARD_SHARE_EXCLUSIVE, _
clsPCSC.SCARD_PROTOCOL_T0, _
hCard, _
Protocol _
)
If ReturnCode <> clsPCSC.SCARD_S_SUCCESS Then
MessageBox.Show( _
"An Error Occurred when connecting to the smarcard" _
& ControlChars.CrLf & "Error Number: " & Hex(ReturnCode), _
"Error!", MessageBoxButtons.OK, MessageBoxIcon.Warning, _
MessageBoxDefaultButton.Button1,
MessageBoxOptions.DefaultDesktopOnly)
Else
List1.Items.Add("Connection OK")
End If
End Sub
HOPEFULLY someone can help
Thanks in advance,


Nov 21 '05 #2
Thx Ken,

I had also read this article, but i have no idea where is the dll
SCARDLIBlib, "SCardLib 1.0 Type library" located...and how to get it, I had
installed ACS driver, but no hope to find this library.

"Ken Tucker [MVP]" <vb***@bellsouth.net> ¼¶¼g©ó¶l¥ó·s»D:uT****************@tk2msftngp13.phx .gbl...
Hi,

Maybe this will help
http://www.aspfree.com/index.php?opt...k=view&id=2108

Ken
----------------
<Windy> wrote in message news:eA**************@TK2MSFTNGP12.phx.gbl...
Hi everyone
Just a quick question! Everytime i run the SCardConnect Command
SCARD_E_INVALID_PARAMETER is returned and i have absolutely no idea why!
I have a VB6 program that works perfectly, but when i try and implement
the
same in VB.NET, I get the SCARD_E_INVALID_PARAMETER error.
I was just wondering if anyone could help? when i debug the program
hContext in VB6 = 0 however in VB.NET it = -855572479 or -855572480. Which
then produces a return code of HEX - 80100004 (SCARD_E_INVALID_PARAMETER)
The code i am using is:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim defaultReader As String
defaultReader = ComboBox1.Text
Protocol = clsPCSC.GetProtocol
ReturnCode = clsPCSC.winSCard.SCardConnect _
( _
hContext, _
defaultReader, _
clsPCSC.SCARD_SHARE_EXCLUSIVE, _
clsPCSC.SCARD_PROTOCOL_T0, _
hCard, _
Protocol _
)
If ReturnCode <> clsPCSC.SCARD_S_SUCCESS Then
MessageBox.Show( _
"An Error Occurred when connecting to the smarcard" _
& ControlChars.CrLf & "Error Number: " & Hex(ReturnCode),
_
"Error!", MessageBoxButtons.OK, MessageBoxIcon.Warning, _
MessageBoxDefaultButton.Button1,
MessageBoxOptions.DefaultDesktopOnly)
Else
List1.Items.Add("Connection OK")
End If
End Sub
HOPEFULLY someone can help
Thanks in advance,

Nov 21 '05 #3
Hi,

I think this is the dll you are looking for

http://www.dlldump.com/download-dll-.../download.html

Ken
-----------------
<Windy> wrote in message news:%2****************@TK2MSFTNGP14.phx.gbl...
Thx Ken,

I had also read this article, but i have no idea where is the dll
SCARDLIBlib, "SCardLib 1.0 Type library" located...and how to get it, I had
installed ACS driver, but no hope to find this library.

"Ken Tucker [MVP]" <vb***@bellsouth.net>
¼¶¼g©ó¶l¥ó·s»D:uT****************@tk2msftngp13.phx .gbl...
Hi,

Maybe this will help
http://www.aspfree.com/index.php?opt...k=view&id=2108

Ken
----------------
<Windy> wrote in message news:eA**************@TK2MSFTNGP12.phx.gbl...
Hi everyone
Just a quick question! Everytime i run the SCardConnect Command
SCARD_E_INVALID_PARAMETER is returned and i have absolutely no idea why!
I have a VB6 program that works perfectly, but when i try and implement
the
same in VB.NET, I get the SCARD_E_INVALID_PARAMETER error.
I was just wondering if anyone could help? when i debug the program
hContext in VB6 = 0 however in VB.NET it = -855572479 or -855572480. Which
then produces a return code of HEX - 80100004 (SCARD_E_INVALID_PARAMETER)
The code i am using is:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim defaultReader As String
defaultReader = ComboBox1.Text
Protocol = clsPCSC.GetProtocol
ReturnCode = clsPCSC.winSCard.SCardConnect _
( _
hContext, _
defaultReader, _
clsPCSC.SCARD_SHARE_EXCLUSIVE, _
clsPCSC.SCARD_PROTOCOL_T0, _
hCard, _
Protocol _
)
If ReturnCode <> clsPCSC.SCARD_S_SUCCESS Then
MessageBox.Show( _
"An Error Occurred when connecting to the smarcard" _
& ControlChars.CrLf & "Error Number: " & Hex(ReturnCode),
_
"Error!", MessageBoxButtons.OK, MessageBoxIcon.Warning, _
MessageBoxDefaultButton.Button1,
MessageBoxOptions.DefaultDesktopOnly)
Else
List1.Items.Add("Connection OK")
End If
End Sub
HOPEFULLY someone can help
Thanks in advance,


Nov 21 '05 #4
oh I have this dll, but when I add reference in VS .Net , i can't add it
successfully,
the error said: "This is not a valid assembly or COM component. Only
assemblies with extension 'dll' and COM components can be referenced. Please
make sure that the file is accessible, and that it is a valid assembly or
COM component.

I also tried to register the dll. but fail to do so.


"Ken Tucker [MVP]" <vb***@bellsouth.net> ¼¶¼g©ó¶l¥ó·s»D:u2**************@TK2MSFTNGP14.phx.g bl...
Hi,

I think this is the dll you are looking for

http://www.dlldump.com/download-dll-.../download.html

Ken
-----------------
<Windy> wrote in message news:%2****************@TK2MSFTNGP14.phx.gbl...
Thx Ken,

I had also read this article, but i have no idea where is the dll
SCARDLIBlib, "SCardLib 1.0 Type library" located...and how to get it, I
had
installed ACS driver, but no hope to find this library.

"Ken Tucker [MVP]" <vb***@bellsouth.net>
¼¶¼g©ó¶l¥ó·s»D:uT****************@tk2msftngp13.phx .gbl...
Hi,

Maybe this will help
http://www.aspfree.com/index.php?opt...k=view&id=2108

Ken
----------------
<Windy> wrote in message news:eA**************@TK2MSFTNGP12.phx.gbl...
Hi everyone
Just a quick question! Everytime i run the SCardConnect Command
SCARD_E_INVALID_PARAMETER is returned and i have absolutely no idea why!
I have a VB6 program that works perfectly, but when i try and implement
the
same in VB.NET, I get the SCARD_E_INVALID_PARAMETER error.
I was just wondering if anyone could help? when i debug the program
hContext in VB6 = 0 however in VB.NET it = -855572479 or -855572480.
Which
then produces a return code of HEX - 80100004 (SCARD_E_INVALID_PARAMETER)
The code i am using is:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim defaultReader As String
defaultReader = ComboBox1.Text
Protocol = clsPCSC.GetProtocol
ReturnCode = clsPCSC.winSCard.SCardConnect _
( _
hContext, _
defaultReader, _
clsPCSC.SCARD_SHARE_EXCLUSIVE, _
clsPCSC.SCARD_PROTOCOL_T0, _
hCard, _
Protocol _
)
If ReturnCode <> clsPCSC.SCARD_S_SUCCESS Then
MessageBox.Show( _
"An Error Occurred when connecting to the smarcard" _
& ControlChars.CrLf & "Error Number: " & Hex(ReturnCode),
_
"Error!", MessageBoxButtons.OK, MessageBoxIcon.Warning, _
MessageBoxDefaultButton.Button1,
MessageBoxOptions.DefaultDesktopOnly)
Else
List1.Items.Add("Connection OK")
End If
End Sub
HOPEFULLY someone can help
Thanks in advance,


Nov 21 '05 #5
I have the same problem.
The SCardLib i not present.
Where i find it?

Thanks
Briain2kx

oh I have this dll, but when I add reference in VS .Net , i can't add it
successfully,
the error said: "This is not a valid assembly or COM component. Only
assemblies with extension 'dll' and COM components can be referenced. Please
make sure that the file is accessible, and that it is a valid assembly or
COM component.

I also tried to register the dll. but fail to do so.




"Ken Tucker [MVP]" <vb2ae@bellsouth.net> ¼¶¼g©ó¶l¥ó·s»D:u2R2mNCkFHA.2916@TK2MSFTNGP14.phx.g bl...[color=blue]
> Hi,
>
> I think this is the dll you are looking for
>
> http://www.dlldump.com/download-dll-.../download.html
>
> Ken
> -----------------
> <Windy> wrote in message news:%23pBRGYAkFHA.2852@TK2MSFTNGP14.phx.gbl...
> Thx Ken,
>
> I had also read this article, but i have no idea where is the dll
> SCARDLIBlib, "SCardLib 1.0 Type library" located...and how to get it, I
> had
> installed ACS driver, but no hope to find this library.
>
>
>
> "Ken Tucker [MVP]" <vb2ae@bellsouth.net>
> ¼¶¼g©ó¶l¥ó·s»D:uTRiUk%23jFHA.3336@tk2msftngp13.phx .gbl...[color=green]
>> Hi,
>>
>> Maybe this will help
>> http://www.aspfree.com/index.php?opt...k=view&id=2108
>>
>> Ken
>> ----------------
>> <Windy> wrote in message news:eACocg1jFHA.3144@TK2MSFTNGP12.phx.gbl...
>> Hi everyone
>>
>>
>> Just a quick question! Everytime i run the SCardConnect Command
>> SCARD_E_INVALID_PARAMETER is returned and i have absolutely no idea why!
>>
>>
>> I have a VB6 program that works perfectly, but when i try and implement
>> the
>> same in VB.NET, I get the SCARD_E_INVALID_PARAMETER error.
>>
>>
>> I was just wondering if anyone could help? when i debug the program
>> hContext in VB6 = 0 however in VB.NET it = -855572479 or -855572480.
>> Which
>> then produces a return code of HEX - 80100004 (SCARD_E_INVALID_PARAMETER)
>>
>>
>> The code i am using is:
>>
>>
>>
>> Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
>> System.EventArgs) Handles Button2.Click
>> Dim defaultReader As String
>> defaultReader = ComboBox1.Text
>> Protocol = clsPCSC.GetProtocol
>>
>>
>> ReturnCode = clsPCSC.winSCard.SCardConnect _
>> ( _
>> hContext, _
>> defaultReader, _
>> clsPCSC.SCARD_SHARE_EXCLUSIVE, _
>> clsPCSC.SCARD_PROTOCOL_T0, _
>> hCard, _
>> Protocol _
>> )
>>
>>
>> If ReturnCode <> clsPCSC.SCARD_S_SUCCESS Then
>> MessageBox.Show( _
>> "An Error Occurred when connecting to the smarcard" _
>> & ControlChars.CrLf & "Error Number: " & Hex(ReturnCode),
>> _
>> "Error!", MessageBoxButtons.OK, MessageBoxIcon.Warning, _
>> MessageBoxDefaultButton.Button1,
>> MessageBoxOptions.DefaultDesktopOnly)
>> Else
>> List1.Items.Add("Connection OK")
>> End If
>> End Sub
>>
>>
>> HOPEFULLY someone can help
>>
>>
>> Thanks in advance,
>>
>>
>>
>>[/color]
>
>
>[/color]
May 18 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Martin | last post by:
I have a couple of questions around code signing with MS technology: 1. Is there a way to transfer the generated strong name signing private key directly to a smartcard (or generate it on the...
1
by: FE-FR | last post by:
Hi, I am currently working on a project using smartcards for authentication. Everything work fine but I have to automate the process and I wonder if you can advise me. Here is the list of...
0
by: Senshodan | last post by:
Hi all, I'm trying to use the SignedXML class in order to create a XMLDSIG signature using a certificate stored in a smartcard. For that purpose I find out the data of the certificate context (...
3
by: jay | last post by:
Hi, I am trying to use smartcard to logon to pc. I am modifying a gina.dll. The question is - is there anyone with the smartcard logon experience who can guide me through the process? I know...
0
by: Philipp | last post by:
Hi everyone. I've already read a lot about accessing SmartCard via C#, but they all don't really fit, what I'm trying to do. I'm experimenting with SLE 4442 Smartcards and I want to directly...
0
by: George | last post by:
Hi all, I'm developing a control or a kind of activex to run on the IExplorer. What I want is to read a file or a smartcard in the client side. When I run the control on a normal .exe...
0
by: unwantedspam | last post by:
Hi All, Thank you in advance. I have a windows CE 4.2 device. I need to be able to insert a smartcard into the reader, prompt the user for a PIN and validate that PIN against what is on the...
0
by: =?Utf-8?B?RGFuUHll?= | last post by:
I am trying to get the SmartCard services to work on Windows PE 2005. I can get the service installed by issuing a "scardsvr.exe install" from a command prompt & the service looks like it starts...
0
by: Jassim | last post by:
we have a national ID card here which is on a smartcard and I want to list and read all the open data in the open layer because the government here provided a dll file which reads few data fron the...
1
by: John Wright | last post by:
I have a prox card reader and just got it installed. Upon the advice of the company I downloaded the SmartCard API from Subsemly. It will see the card, but it doesn't give very good examples of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.