双11狂欢大促

盲盒赢 定制羽绒服

开启惊喜盲盒,抽取你的专属好礼

— 惊喜奖品抢先看 —

很短的一段VC代码转D代码

chengangcsdn chengangcsdn 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
char strBuf[1024] = {0};


CFile file;
char* pReadbuf = NULL;
char* pSend = NULL;
long lSize = 0;


if(!file.Open("e:\\x1.jpg", CFile::modeRead | CFile::shareDenyWrite))
{
//_OutPut("打开文件失败\n");
}
else
{

lSize = file.GetLength();
pReadbuf = new char[lSize];
memset(pReadbuf, 0, lSize);


CString strCMD;
strCMD.Format("<ILAS>31;;T00516;%d;", lSize);
int nCmdLen = strlen(strCMD);

file.ReadHuge(pReadbuf, lSize);

//ADD ;</ILAS>
int nSendSize = nCmdLen + lSize + 8;
pSend = new char[nSendSize];

memset(pSend, 0, nSendSize);

memcpy(pSend, strCMD.GetBuffer(0), nCmdLen);
memcpy(pSend + nCmdLen, pReadbuf, lSize);

char strTmp[] = ";</ILAS>";

memcpy(pSend + nCmdLen + lSize, strTmp, strlen(strTmp));

delete[] pReadbuf;
delete[] pSend;
}
...全文
评论 15
收藏 已收藏
分享
返回顶部