Posted by bobr
(188.8.131.52) on January 07, 2008 at 11:00:55:
I am trying to use the C/C++ API with the BasicCard API/OCX. I am having some problems with reader detection while my application is running.
If the reader is connected when I start my program, I successfully detect the reader. However, if the reader is not connected when my program starts, it seems that I can never detect the reader.
If the reader is connected when my program starts, for the remainder of the program lifetime ZCCriGetReaderCount() will always return a count of 1, even if the reader is subsequently disconnected. If the reader is not connected when my program starts, for the remainder of the program lifetime ZCCriGetReaderCount() will always return a count of 0, even if the reader is subsequently connected.
I see similar behavior with other API calls... ZCCriOpenReader() will successfully open the reader if it was connected at startup, but not if it was disconnected.
If I stop and restart the program, reader detection always works as expected. However, in my application, I need to be able to detect the reader even if its connected after application start.
It seems as though the OCX is somehow caching the reader connection state at startup and never refreshing this information. I can not find an API function to force the detection of the reader?
Is this a known issue? Am I doing something stupid? Can anyone offer any suggestions on how to detect the reader after program start?