* Sample18.cpp : Defines the entry point for the console application.
* ==========================================================================
* Check managment code with DIC_FindByMgrCode
* ==========================================================================


#include "Dic32_Vfp.h"
clear 
DECLARE integer   DIC_Find IN Dic32u.dll
DECLARE integer   DIC_FindByMgrCode IN Dic32u.dll string @pMgrCode
DECLARE integer   DIC_Open IN Dic32u.dll integer hic, string @  reader_name
DECLARE integer   DIC_Close  IN Dic32u.dll  integer   hic
DECLARE integer   DIC_Command  IN Dic32u.dll  integer  hic, integer cmd, string @  cmddata
DECLARE integer   DIC_Get  IN Dic32u.dll  string @xdata, integer  p1, integer   p2, string @buffer
DECLARE integer   DIC_Set  IN Dic32u.dll  string @xdata, integer  p1, integer  p2, integer   p3, string @buffer


store 0 to  errcode		   && error code 
store 0 to  num		   && number of founded card reader(s)
store 0 to  hic		   && handle of ROCKEY device.
store 0 to  i

cmddata = space(1024)
buffer = space(1024)

	?"Find Card by Manager Code..."
	
	*Check managment code with DIC_FindByMgrCode
	for i=0 to 8
		DIC_Set(@cmddata,i,1,0xff,NULL)
	endfor

	num = DIC_FindByMgrCode(@cmddata)
	
	?"Find Card",num
clear dlls
return 	