Juan,
You can also solve problem one "port in use" by going to Services and
stopping the service labelled "Smart Card".
Chris Kesik
Tallan
-----Original Message-----
From: Juan de Ituarte
To: [EMAIL PROTECTED]
Sent: 8/8/01 3:50 AM
Subject: [OCF] prblms
Hi there!
I've got two problems that I expect to solve with you help. First of
all,
the reader I have is Gemplus GCR410 and I'm running Windows2000.
In the first of the two machines that I'm using the reader is already
installed and when trying the first sample code from the 'OCF
Programmer's
Guide' (See below) I get an error saying that another application is
already
using the port (COM1), in fact the message is "Port already owned by an
Unknown windows application". I have no application accessing the port
but
the driver, or the Smart Card service, but even turning the service off
i
get the same error. Any clue? Thanks a lot.
And the problem in the second machine is that I cannot install the
reader's
drivers. It's a W2000 machine as well, and when installing the drivers,
a
dialog box saying that this operating system is not supported appears.
Anyone knows the solution for this?
Thank you very much indeed!!
/Slds
PS: Here you are the sample code from the "OCF Programmer's Guide"
SOURCE:
package inetsmart;
import opencard.core.service.SmartCard;
import opencard.core.service.CardRequest;
import opencard.opt.iso.fs.FileAccessCardService;
import opencard.opt.iso.fs.CardFile;
public class ReadFile {
public static void main(String[] args) {
System.out.println("Reading SmartCard File...");
try {
SmartCard.start();
CardRequest cr = new CardRequest(CardRequest.NEWCARD, null,
FileAccessCardService.class);
SmartCard sc = SmartCard.waitForCard(cr);
FileAccessCardService facs = (FileAccessCardService)
sc.getCardService(FileAccessCardService.class, true);
CardFile root = new CardFile(facs);
CardFile file = new CardFile(root, ":c009");
byte[] data = facs.read(file.getPath(), 0, file.getLength());
sc.close();
String valor = new String(data);
valor = valor.trim();
System.out.println("The value is: "+valor);
} catch (Exception e) {
e.printStackTrace(System.err);
} finally {
try{
SmartCard.shutdown();
} catch (Exception e1) {
e1.printStackTrace(System.err);
}
}
System.exit(0);
}
}
No errors compiling, btw.
_________________________________________________________________
Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp
---
> Visit the OpenCard web site at http://www.opencard.org/ for more
> information on OpenCard---binaries, source code, documents.
> This list is being archived at
http://www.opencard.org/archive/opencard/
! To unsubscribe from the [EMAIL PROTECTED] mailing list send an
email
! to
! [EMAIL PROTECTED]
! containing the word
! unsubscribe
! in the body.
---
> Visit the OpenCard web site at http://www.opencard.org/ for more
> information on OpenCard---binaries, source code, documents.
> This list is being archived at http://www.opencard.org/archive/opencard/
! To unsubscribe from the [EMAIL PROTECTED] mailing list send an email
! to
! [EMAIL PROTECTED]
! containing the word
! unsubscribe
! in the body.