Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15754

Could anyone help me on this?

$
0
0
i was required to use the c++ to communicate with the vb 6
and below is the method which i suppose to follow with

Public Declare Function SCT3Q8_ConnectDevice Lib "SCT3Q8_API.dll" (ByVal strCommPort As String, ByVal lngBaudRate As Long, ByRef RespData As sRespData) As Long

the method above was being used in the module
and below would be my current code

Public Declare Function MTK_ConnectDevice Lib "MTKF32X3_API.dll" (ByVal lngdwPort, ByVal lngdwSpeed) As Long

and the c++ which i require to connect with is look like this
MTKF32X3_API_API long __stdcall MTK_ConnectDevice(long dwPort, long dwSpeed)
{
long lngResult, lngRtn;
char strMsg[512];
memset((void*)strMsg, '\0', sizeof(strMsg));
READERHANDLE ptrCardDispenser;

try {
lngResult = F3_Connect(dwPort, dwSpeed, NULL, &ptrCardDispenser);
if(lngResult == 0) {
g_Reader = &ptrCardDispenser;
lngRtn = 0;


} else {
lngRtn = -1;

}

//Gabarge Collection.
//if (ptrCardDispenser != NULL) { delete[] ptrCardDispenser; ptrCardDispenser = NULL; }

return lngRtn;
} catch (exception& e) {
sprintf_s(strMsg, "Exception@ReadIni: %s", e.what());
WriteError(strMsg);
return -1;
}
}

and my issue is even though i had being provided a sample to c++ with vb6, but i not sure how am i gonna use it.Hope anyone who understand this can help me and really appreciate for all ur help

Viewing all articles
Browse latest Browse all 15754

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>