By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,589 Members | 1,026 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,589 IT Pros & Developers. It's quick & easy.

smartcard

P: n/a
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
Share this Question
Share on Google+
5 Replies

P: n/a
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

P: n/a
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> 级糶秎ン穝籇: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

P: n/a
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>
级糶秎ン穝籇: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

P: n/a
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> 级糶秎ン穝籇: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>
级糶秎ン穝籇: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

P: 1
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> 级糶秎ン穝籇: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>
> 级糶秎ン穝籇: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 discussion thread is closed

Replies have been disabled for this discussion.