谁有在VB中调用自己编的win 32 DLL例子?
jing 2000-02-16 07:35:00 我的DLL program
#include "stdafx.h"
int _declspec(dllexport) MyFunc(int a,double b);
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
int _declspec(dllexport) MyFunc(int a,double b)
{
return a;
}
DEF
LIBRARY dlltest
EXPORTS
MyFunc
在VB中
Public Declare Function MyFunc Lib "dlltest.DLL" (ByVal a As Long, ByVal b As Double) As Integer
Private Sub Command1_Click()
Print MyFunc(1, 1.21)
End Sub
ERRORMESSAGE:
bad DLL calling convention