两个参数不同的结构体指针进行赋值,(DWORD)lpImage获取到的值是一个几百万的数字,
pImageData被设定的各个参数的值也是5位到10几位的数字。
不知道这些值是怎么设置出来的,pImage的内容是不是设的不对,应该怎么设?
IMAGEDATA *pImageData;
lpImage = (IMAGE *)pImage;
IMAGE* image=NULL;
{
image=new IMAGE;
memcpy(image->szID, "20", 20);
memcpy(image->szShubetsu, "12", 2);
memcpy(image->szDate, "20130823", 8);
memcpy(image->szTantou, "1234567890", 10);
image->sJoudaiFlag=1;
image->sJoudaiTouroku=2;
image->sKaiinFlag=3;
image->sJokabuFlag=4;
memcpy(image->szTorihikiCode, "34", 2);
memcpy(image->szLot, "56", 2);
memcpy(image->szKeiro, "78", 2);
image->sUketsukeNo=5;
memcpy(image->szNewID, "9527", 176);
image->sKabuZeor=6;
image->sImageCnt=7;
image->sImageCnt=8;
image->cKakuFlag = '9';
memcpy(image->Yobi, "9528", 43);
}
char* str2 = (char*)image;
pImageData = (IMAGEDATA *)((DWORD)lpImage + sizeof(IMAGE));
结构体定义如下:
typedef struct
{ char szID[20];
char szShubetsu[2];
char szDate[8];
char szTantou[10];
short sJoudaiFlag;
short sJoudaiTouroku;
short sKaiinFlag;
short sJokabuFlag;
char szTorihikiCode[2];
char szLot[2];
char szKeiro[2];
short sUketsukeNo;
char szNewID[20];
short sKabuZeor;
short sImageCnt;
long lDataLen;
char cKakuFlag;
char Yobi[43];
}IMAGE;
typedef struct
{ unsigned short sSignMode;
unsigned short sMabikiFlag;
unsigned long lImgLen;
unsigned long lSignLen;
unsigned short sLineLen;
unsigned short sLineCnt;
}IMAGEDATA; |