高手请教啊!!!
如何将DLL中引用函数(C语言格式)转为VB定义格式?
例如:
typedef struct _DRIVER_INFO_OK
{
char ModalNumber[40];
char SerialNumber[20];
char ControlNum[8];
DWORD DriveType;
DWORD Cylinders;
DWORD Heads;
DWORD Sectors;
} DRIVER_INFO_OK, *PDRIVE_INFO_OK;int  ReadPhysicalDriveInNT(const int idrive,PDRIVE_INFO_OK buf,int buflen)
其中,buf变量是指针.上面的定义在VB中如何引用啊!!!

解决方案 »

  1.   

    Visaul Studio6里有个APIView,在里面查就可以了,它会以VB格式把DLL里面的API原型显示给你的,你把经复制到程序里就OK了
      

  2.   

    楼上的仁兄,那不是WINDOWS里的DLL
    是VC编的DLL , 如何转换啊???
      

  3.   

    Public Type DRIVER_INFO_OK
      ModalNumber(39) As Byte
      SerialNumber(19) As Byte
      ControlNum(7) As Byte
      DriveType As Long
      Cylinders As Long
      Heads As Long
      Sectors As Long
    End TypePublic Declare ReadPhysicalDriveInNT Lib "xx.dll" (ByVal idrive As Long ,buf As DRIVE_INFO_OK,ByVal buflen As Long) As Long
      

  4.   

    supergreenbean(超级绿豆) 回答应该是对的。
    DLL 与 VB 数据类型对应表   
    类型    C 语言中的声明         VB 中的声明
    8 位数值参数  char chMyChar    ByVal chMyChar As Byte
                  BYTE chMyByte    ByVal chMyByte As Byte
    16 位数值参数 short nMyShort   ByVal nMyShort As Integer
                  WORD wMyWord     ByVal wMyWord As Integer
    32 位数值参数 int nMyInt       ByVal nMyInt As Long
                  UINT wMyUint     ByVal nMyUint As Long
                  BOOL bMyBool     ByVal nMyBool As Long
                  DWORD dwMyDWord  ByVal dwMyDWord As Long
                  LONG lMyLong     ByVal lMyLong As Long
    浮点数        float MyFloat    ByVal MyFloat As Single
                  double MyDouble  ByVal MyDouble As Double
    变体          VARIANT MyVar    ByVal MyVar As VARIANT
                  VARIANTARG MyVar ByVal MyVar As VARIANT
    句柄          HWND hWnd        ByVal hWnd As Long
                  HPEN hPen        ByVal hPen As Long
                  HGLOBAL hglbl    ByVal hglbl As Long--