M
Mohamed Fysal
Hi,
I have a major problem.
I am using a VB exe which is having a structure declared and it looks like
below
Public Type SCANNEDIBUTTNO
IButtonUserNumber As String * 32
End Type
Public Type BOOKINGIDPARAM
bkidno(14) As SCANNEDIBUTTNO
End Type
Public Type TRACKERMESSAGEINFO
bkidp As BOOKINGIDPARAM
End Type
And I have declared a varaible for TRACKERMESSAGEINFO as tmi
and the value for IButtonUserNumber is a Hex value which is stored as
follows:
textValue1 = 'EFABCD12'
textValue2 = 'EFABCD13'
textValue3 = 'EFABCD14'
Mid$(tmi.bkidp.bkidno(0).IButtonUserNumber, 1, Len(textValue1)) = textValue1
Mid$(tmi.bkidp.bkidno(1).IButtonUserNumber, 1, Len(textValue2)) = textValue2
Mid$(tmi.bkidp.bkidno(2).IButtonUserNumber, 1, Len(textValue3)) = textValue3
and so on.....
When the above structure variable tmi is passed to a VC++ Win 32 DLL, the
string value is stored in a different way.
whereby I have declared the structure in VC++ DLL as follows:
typedef struct tagSCANNEDIBUTTONNO
{
char IButtonUserNumber[32];
} SCANNEDIBUTTNO, FAR * LPSCANNEDIBUTTNO;
typedef struct tagBOOKINGIDPARAM
{
SCANNEDIBUTTNO bkidno[15];
} BOOKINGIDPARAM, FAR * LPBOOKINGIDPARAM;
typedef struct tagTRACKERMESSAGEINFO
{
BOOKINGIDPARAM bkidp;
} TRACKERMESSAGEINFO, FAR * LPTRACKERMESSAGEINFO;
When the value is passed to the VC++ dll i get the value as follows
LPTRACKERMESSAGEINFO lptmi
lptmi->bkidp.bkidno(0).IButtonUserNumber[0] = ''
lptmi->bkidp.bkidno(0).IButtonUserNumber[1] = ''
lptmi->bkidp.bkidno(0).IButtonUserNumber[2] = 'E'
lptmi->bkidp.bkidno(0).IButtonUserNumber[3] = 'F'
lptmi->bkidp.bkidno(0).IButtonUserNumber[4] = 'A'
lptmi->bkidp.bkidno(0).IButtonUserNumber[5] = 'B'
lptmi->bkidp.bkidno(0).IButtonUserNumber[6] = 'C'
lptmi->bkidp.bkidno(0).IButtonUserNumber[7] = 'D'
lptmi->bkidp.bkidno(0).IButtonUserNumber[8] = '1'
lptmi->bkidp.bkidno(0).IButtonUserNumber[9] = '2'
lptmi->bkidp.bkidno(0).IButtonUserNumber[10] = ''
lptmi->bkidp.bkidno(0).IButtonUserNumber[11] = ''
....
....
...
lptmi->bkidp.bkidno(0).IButtonUserNumber[31] = ''
and
lptmi->bkidp.bkidno(1).IButtonUserNumber[0] = ''
lptmi->bkidp.bkidno(1).IButtonUserNumber[1] = ''
lptmi->bkidp.bkidno(1).IButtonUserNumber[2] = 'E'
lptmi->bkidp.bkidno(1).IButtonUserNumber[3] = 'F'
lptmi->bkidp.bkidno(1).IButtonUserNumber[4] = 'A'
lptmi->bkidp.bkidno(1).IButtonUserNumber[5] = 'B'
lptmi->bkidp.bkidno(1).IButtonUserNumber[6] = 'C'
lptmi->bkidp.bkidno(1).IButtonUserNumber[7] = 'D'
lptmi->bkidp.bkidno(1).IButtonUserNumber[8] = '1'
lptmi->bkidp.bkidno(1).IButtonUserNumber[9] = '3
lptmi->bkidp.bkidno(1).IButtonUserNumber[10] = ''
lptmi->bkidp.bkidno(1).IButtonUserNumber[11] = ''
....
....
...
lptmi->bkidp.bkidno(1).IButtonUserNumber[31] = ''
and
lptmi->bkidp.bkidno(2).IButtonUserNumber[0] = ''
lptmi->bkidp.bkidno(2).IButtonUserNumber[1] = ''
lptmi->bkidp.bkidno(2).IButtonUserNumber[2] = 'E'
lptmi->bkidp.bkidno(2).IButtonUserNumber[3] = 'F'
lptmi->bkidp.bkidno(2).IButtonUserNumber[4] = 'A'
lptmi->bkidp.bkidno(2).IButtonUserNumber[5] = 'B'
lptmi->bkidp.bkidno(2).IButtonUserNumber[6] = 'C'
lptmi->bkidp.bkidno(2).IButtonUserNumber[7] = 'D'
lptmi->bkidp.bkidno(2).IButtonUserNumber[8] = '1'
lptmi->bkidp.bkidno(2).IButtonUserNumber[9] = '4'
lptmi->bkidp.bkidno(2).IButtonUserNumber[10] = ''
lptmi->bkidp.bkidno(2).IButtonUserNumber[11] = ''
....
....
...
lptmi->bkidp.bkidno(2).IButtonUserNumber[31] = ''
So i do not know why there is an empty space of two bytes before the actual
values (EFABCD12) , (EFABCD13) , and (EFABCD14) ?????????????
Please help me in this regard..........
I have a major problem.
I am using a VB exe which is having a structure declared and it looks like
below
Public Type SCANNEDIBUTTNO
IButtonUserNumber As String * 32
End Type
Public Type BOOKINGIDPARAM
bkidno(14) As SCANNEDIBUTTNO
End Type
Public Type TRACKERMESSAGEINFO
bkidp As BOOKINGIDPARAM
End Type
And I have declared a varaible for TRACKERMESSAGEINFO as tmi
and the value for IButtonUserNumber is a Hex value which is stored as
follows:
textValue1 = 'EFABCD12'
textValue2 = 'EFABCD13'
textValue3 = 'EFABCD14'
Mid$(tmi.bkidp.bkidno(0).IButtonUserNumber, 1, Len(textValue1)) = textValue1
Mid$(tmi.bkidp.bkidno(1).IButtonUserNumber, 1, Len(textValue2)) = textValue2
Mid$(tmi.bkidp.bkidno(2).IButtonUserNumber, 1, Len(textValue3)) = textValue3
and so on.....
When the above structure variable tmi is passed to a VC++ Win 32 DLL, the
string value is stored in a different way.
whereby I have declared the structure in VC++ DLL as follows:
typedef struct tagSCANNEDIBUTTONNO
{
char IButtonUserNumber[32];
} SCANNEDIBUTTNO, FAR * LPSCANNEDIBUTTNO;
typedef struct tagBOOKINGIDPARAM
{
SCANNEDIBUTTNO bkidno[15];
} BOOKINGIDPARAM, FAR * LPBOOKINGIDPARAM;
typedef struct tagTRACKERMESSAGEINFO
{
BOOKINGIDPARAM bkidp;
} TRACKERMESSAGEINFO, FAR * LPTRACKERMESSAGEINFO;
When the value is passed to the VC++ dll i get the value as follows
LPTRACKERMESSAGEINFO lptmi
lptmi->bkidp.bkidno(0).IButtonUserNumber[0] = ''
lptmi->bkidp.bkidno(0).IButtonUserNumber[1] = ''
lptmi->bkidp.bkidno(0).IButtonUserNumber[2] = 'E'
lptmi->bkidp.bkidno(0).IButtonUserNumber[3] = 'F'
lptmi->bkidp.bkidno(0).IButtonUserNumber[4] = 'A'
lptmi->bkidp.bkidno(0).IButtonUserNumber[5] = 'B'
lptmi->bkidp.bkidno(0).IButtonUserNumber[6] = 'C'
lptmi->bkidp.bkidno(0).IButtonUserNumber[7] = 'D'
lptmi->bkidp.bkidno(0).IButtonUserNumber[8] = '1'
lptmi->bkidp.bkidno(0).IButtonUserNumber[9] = '2'
lptmi->bkidp.bkidno(0).IButtonUserNumber[10] = ''
lptmi->bkidp.bkidno(0).IButtonUserNumber[11] = ''
....
....
...
lptmi->bkidp.bkidno(0).IButtonUserNumber[31] = ''
and
lptmi->bkidp.bkidno(1).IButtonUserNumber[0] = ''
lptmi->bkidp.bkidno(1).IButtonUserNumber[1] = ''
lptmi->bkidp.bkidno(1).IButtonUserNumber[2] = 'E'
lptmi->bkidp.bkidno(1).IButtonUserNumber[3] = 'F'
lptmi->bkidp.bkidno(1).IButtonUserNumber[4] = 'A'
lptmi->bkidp.bkidno(1).IButtonUserNumber[5] = 'B'
lptmi->bkidp.bkidno(1).IButtonUserNumber[6] = 'C'
lptmi->bkidp.bkidno(1).IButtonUserNumber[7] = 'D'
lptmi->bkidp.bkidno(1).IButtonUserNumber[8] = '1'
lptmi->bkidp.bkidno(1).IButtonUserNumber[9] = '3
lptmi->bkidp.bkidno(1).IButtonUserNumber[10] = ''
lptmi->bkidp.bkidno(1).IButtonUserNumber[11] = ''
....
....
...
lptmi->bkidp.bkidno(1).IButtonUserNumber[31] = ''
and
lptmi->bkidp.bkidno(2).IButtonUserNumber[0] = ''
lptmi->bkidp.bkidno(2).IButtonUserNumber[1] = ''
lptmi->bkidp.bkidno(2).IButtonUserNumber[2] = 'E'
lptmi->bkidp.bkidno(2).IButtonUserNumber[3] = 'F'
lptmi->bkidp.bkidno(2).IButtonUserNumber[4] = 'A'
lptmi->bkidp.bkidno(2).IButtonUserNumber[5] = 'B'
lptmi->bkidp.bkidno(2).IButtonUserNumber[6] = 'C'
lptmi->bkidp.bkidno(2).IButtonUserNumber[7] = 'D'
lptmi->bkidp.bkidno(2).IButtonUserNumber[8] = '1'
lptmi->bkidp.bkidno(2).IButtonUserNumber[9] = '4'
lptmi->bkidp.bkidno(2).IButtonUserNumber[10] = ''
lptmi->bkidp.bkidno(2).IButtonUserNumber[11] = ''
....
....
...
lptmi->bkidp.bkidno(2).IButtonUserNumber[31] = ''
So i do not know why there is an empty space of two bytes before the actual
values (EFABCD12) , (EFABCD13) , and (EFABCD14) ?????????????
Please help me in this regard..........