请教用C++以及VB的朋友

xsaog 2008-01-07 11:48:17
请问有没有用C的朋友指点一下用VB做下面的代码怎么搞,谢谢


temp.datatype = ((temp.datatype&0x00FF)<<8)+((temp.datatype&0xFF00)>>8);
temp.lg= ((temp.lg&0x000000FF)<<24)+((temp.lg&0x0000FF00)<<8)+((temp.lg&0x00FF0000)>>8)+((temp.lg&0xFF000000)>>24);
temp.lt= ((temp.lt&0x000000FF)<<24)+((temp.lt&0x0000FF00)<<8)+((temp.lt&0x00FF0000)>>8)+((temp.lt&0xFF000000)>>24);
temp.co= ((temp.co&0x00FF)<<8)+((temp.co&0xFF00)>>8);
temp.lsp= ((temp.lsp&0x00FF)<<8)+((temp.lsp&0xFF00)>>8);

...全文
91 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
of123 2008-01-07
  • 打赏
  • 举报
回复
这样也可以:

Dim strTmp As String

strTmp = Right("000" & Hex(temp.datatype), 4)
temp.datatype = Val("&H" & Right(strTmp, 2) & Left(strTmp, 2))

strTmp = Right("0000000" & Hex(temp.lg), 8)
temp.lg = Val("&H" & Right(strTmp, 2) & Lef(strTmp, 6))
...
of123 2008-01-07
  • 打赏
  • 举报
回复

temp.datatype = ((temp.datatype And &HFF)* 2^8)+(temp.datatype \ 2^8);
temp.lg= ((temp.lg And &HFF) * 2^24)+((temp.lg And &HFF00)* 2^8)+((temp.lg And &HFF0000)\ 2^8)+((temp.lg \ 2^24);
....
xsaog 2008-01-07
  • 打赏
  • 举报
回复
多谢of123拔刀相助!完全好用!!多谢了!

再问个问题!:^^
sprintf(cTemp,"%u%02u.%04d",temp.lg/600000, (temp.latitude-(temp.lg/600000)*600000)/10000,temp.lg%10000);

VB 里面没有 sprintf 怎么处理呢?

7,785

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧