G
Guest
Hi,
I need to call a dll function but have no idea how to declare the function
in VB.NET
In the .h file, it is declare as follows:
int CALLBACK gscBsiGcReadTagList(
IN UTILCardHandle hCard, /* Card communication handle */
IN unsigned char* usAID, /* Container AID */
IN unsigned int unAIDLen, /* Container AID length */
OUT GCTag* pTagArray,/* Array of tags */
INOUT unsigned int* pnTagNb /* Number of tags in array */
);
In the C sample code, it is called as follows
void CreateDataInContainer()
{
long lResp = BSI_OK;
unsigned char usAID[BUFSIZ];
unsigned int unAIDLen=0;
char szLecture[BUFSIZ];
GCTag ucTag=0;
unsigned int unTag=1;
unsigned char usValue[500];
unsigned int unValueLen=0;
printf ("\ngscBsiGcDataCreate");
unAIDLen = sizeof (usAID);
GetContainerAID ( usAID, &unAIDLen);
GetString ("\nEnter Tag", szLecture, sizeof (szLecture));
sscanf (szLecture, "%d", &unTag);
ucTag = (char)unTag;
GetString ("\nEnter Data Value ", szLecture, sizeof (szLecture));
strcpy ((char *)usValue, szLecture);
unValueLen = strlen (szLecture);
printf("\nSize of value=%d",unValueLen);
lResp = gscBsiGcDataCreate(
hCard,
usAID,
unAIDLen,
ucTag,
usValue,
unValueLen
);
if (lResp != BSI_OK)
{
DisplayError(" ... ", lResp);
}
else
{
printf ("\n ... OK\n");
}
}
So, can anyone help me with the declaration and calling in VB.NET or VB6?
Thanks!
I need to call a dll function but have no idea how to declare the function
in VB.NET
In the .h file, it is declare as follows:
int CALLBACK gscBsiGcReadTagList(
IN UTILCardHandle hCard, /* Card communication handle */
IN unsigned char* usAID, /* Container AID */
IN unsigned int unAIDLen, /* Container AID length */
OUT GCTag* pTagArray,/* Array of tags */
INOUT unsigned int* pnTagNb /* Number of tags in array */
);
In the C sample code, it is called as follows
void CreateDataInContainer()
{
long lResp = BSI_OK;
unsigned char usAID[BUFSIZ];
unsigned int unAIDLen=0;
char szLecture[BUFSIZ];
GCTag ucTag=0;
unsigned int unTag=1;
unsigned char usValue[500];
unsigned int unValueLen=0;
printf ("\ngscBsiGcDataCreate");
unAIDLen = sizeof (usAID);
GetContainerAID ( usAID, &unAIDLen);
GetString ("\nEnter Tag", szLecture, sizeof (szLecture));
sscanf (szLecture, "%d", &unTag);
ucTag = (char)unTag;
GetString ("\nEnter Data Value ", szLecture, sizeof (szLecture));
strcpy ((char *)usValue, szLecture);
unValueLen = strlen (szLecture);
printf("\nSize of value=%d",unValueLen);
lResp = gscBsiGcDataCreate(
hCard,
usAID,
unAIDLen,
ucTag,
usValue,
unValueLen
);
if (lResp != BSI_OK)
{
DisplayError(" ... ", lResp);
}
else
{
printf ("\n ... OK\n");
}
}
So, can anyone help me with the declaration and calling in VB.NET or VB6?
Thanks!