A
AAVarda
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*)pcDevName))!=MICR_ST_DEVICE_NOT_FOUND
{
//Device found, increment the device number
i++;
}
My defination in VB .NET to get the pcDevName
--------------------------------------
Declare Auto Function fGetDeviceName Lib "mtmcrapi.dll" Alias
"MTMICRGetDevice" (ByVal intNum As Integer, ByRef strDName As Char) As
Integer
Private Sub cmdConnect_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdConnect.Click
Dim strMy As Char
Dim intI As Integer
Dim strRst As Integer
intI = 2
strRst = Win32.fGetDeviceName(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*)pcDevName))!=MICR_ST_DEVICE_NOT_FOUND
{
//Device found, increment the device number
i++;
}
My defination in VB .NET to get the pcDevName
--------------------------------------
Declare Auto Function fGetDeviceName Lib "mtmcrapi.dll" Alias
"MTMICRGetDevice" (ByVal intNum As Integer, ByRef strDName As Char) As
Integer
Private Sub cmdConnect_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdConnect.Click
Dim strMy As Char
Dim intI As Integer
Dim strRst As Integer
intI = 2
strRst = Win32.fGetDeviceName(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