fchen

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
VB结构体的字节对齐和VC结构体的字节对齐有什么区别

DISP_FUNCTION_ID(CSCMUSBINFAXCtrl,"AddLongs_Pointer",2,AddLongs_Pointer,VT_I4 ,VTS_PI2)
vc的接口函数没有char指针类型的输入参数(VTS_),在vb中应用时定义一个结构体:
Private Type USB_iobuf
  led1 As Integer
  led2 As Byte
  port As Byte
  analog1 As Byte
  analog2 As Byte
  not_used(59) As Byte
End Type
将led1的integer地址传入接口(占2位),以后的地址就是char的对应数组了.
posted on 2008-03-14 19:43  wills  阅读(947)  评论(0)    收藏  举报