新增一個def文件如:tmp.def
內容如下:
LIBRARY DiskFree.dll
DESCRIPTION 'This is xx's Dll'
EXPORTS
DiskFree @1包含時加上別名:
Public Declare Function DiskFree Lib "DiskFree.dll" Alias "#1"(ByVal DirveX As Integer) As
內容如下:
LIBRARY DiskFree.dll
DESCRIPTION 'This is xx's Dll'
EXPORTS
DiskFree @1包含時加上別名:
Public Declare Function DiskFree Lib "DiskFree.dll" Alias "#1"(ByVal DirveX As Integer) As
Public Declare Function DiskFree Lib "DiskFree.dll" (ByVal DirveX As Long) As Long
在VB工程 引用中引用你的DLL,在声明区声明
Public Declare Function yourDll Lib "yourDll.dll" Alias "#1"(ByVal DirveX As Integer)
unsigned long WINAPI DiskFree(unsigned int drive)
好像是这样的,不果,我以前做的和你的dll类型可能不一样
extern "C" unsigned long __stdcall DiskFree(....)
在.DEF文件
EXPORTS
DiskFree @1
重新编译DLL
在VB中使用即可