还是不行啊!// PrintSlant.h
// defined with this macro as being exported.
#ifdef PRINTSLANT_EXPORTS
#define PRINTSLANT_API __declspec(dllexport)
#else
#define PRINTSLANT_API __declspec(dllimport)
#endifPRINTSLANT_API int __stdcall maxxy();
// PrintSlant.cpp : Defines the entry point for the DLL application.
//#include "stdafx.h"
#include "PrintSlant.h"BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
// This is an example of an exported function
PRINTSLANT_API int __stdcall maxxy()
{
return 34;
}
问题在哪里?
1、 vc 中的.def文件中没有对函数进行说明。
2、接口参数类型不兼容。
3、你是否将.dll文件考到VB工程目录下或者WIN32目录下
你可以用向DLL工程中加一些AfxMessageBox()语句,作为调试。
我刚刚完成一个类似的程序,还有什么问题,与我联系。
[email protected]
YangyiOfWh(阿一),
问题可能是 2、接口参数类型不兼容
我想向DLL函数传递一个结构体,如LOGFONT,我该如何设置DLL的函数的参数和VB调用的参数?
请指教,
已经mail给你!