Hello there.
There is a DLL file which contains a function as below. It will return me
the device name i.e pcDevName
ULONG MTMICRGetDevice (
DWORD dwDeviceContext ,
char *pcDevName
);
Example given to use the above function is as below
-----------------------------------------
#define DEVICE_NAME_LEN 128
int i=1;
DWORD dwResult;
char pcDevName[DEVICE_NAME_LEN] = "";
while ((dwResult =
MTMICRGetDevice (i,(char*)pcDev Name))!=MICR_ST _DEVICE_NOT_FOU ND
{
//Device found, increment the device number
i++;
}
My defination in VB .NET to get the pcDevName
--------------------------------------
Declare Auto Function fGetDeviceName Lib "mtmcrapi.d ll" Alias
"MTMICRGetDevic e" (ByVal intNum As Integer, ByRef strDName As Char) As
Integer
Private Sub cmdConnect_Clic k(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles cmdConnect.Clic k
Dim strMy As Char
Dim intI As Integer
Dim strRst As Integer
intI = 2
strRst = Win32.fGetDevic eName(intI, strMy)
MessageBox.Show (strMy.ToString , strRst.ToString )
End Sub
The function is returning the value 0 (that means ok) but the device name is
one char junk.
-WHAT IS WRONG???
-Is there a way to get the data by using the memory address in VB .NET
There is a DLL file which contains a function as below. It will return me
the device name i.e pcDevName
ULONG MTMICRGetDevice (
DWORD dwDeviceContext ,
char *pcDevName
);
Example given to use the above function is as below
-----------------------------------------
#define DEVICE_NAME_LEN 128
int i=1;
DWORD dwResult;
char pcDevName[DEVICE_NAME_LEN] = "";
while ((dwResult =
MTMICRGetDevice (i,(char*)pcDev Name))!=MICR_ST _DEVICE_NOT_FOU ND
{
//Device found, increment the device number
i++;
}
My defination in VB .NET to get the pcDevName
--------------------------------------
Declare Auto Function fGetDeviceName Lib "mtmcrapi.d ll" Alias
"MTMICRGetDevic e" (ByVal intNum As Integer, ByRef strDName As Char) As
Integer
Private Sub cmdConnect_Clic k(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles cmdConnect.Clic k
Dim strMy As Char
Dim intI As Integer
Dim strRst As Integer
intI = 2
strRst = Win32.fGetDevic eName(intI, strMy)
MessageBox.Show (strMy.ToString , strRst.ToString )
End Sub
The function is returning the value 0 (that means ok) but the device name is
one char junk.
-WHAT IS WRONG???
-Is there a way to get the data by using the memory address in VB .NET
Comment