写过VB、VC混编进,VB调用C++ DLL can't find dll entry point mConSendExample in *.dll
windowsXP下:dll 用VC6;调用用VB6
.h
#define WM_EXAMWM_USER+130
#ifdef MYPROCESS_EXPORTS
#define MYPROCESS_API __declspec(dllexport)
#else
#define MYPROCESS_API __declspec(dllimport)
#endif
typedef struct B
{
float Press;
int Lushu;
int Flag;
}SendDate;
MYPROCESS_API voidWINAPI mConSendExample();
.cpp
#define MYPROCESS_EXPORTS
#include "PLCProcess.h"
MYPROCESS_API void WINAPImConSendExample()
{
SendDate sTemp;
sTemp.Press=100;
sTemp.Lushu=10;
sTemp.Flag=1;
SendMessage(m_ConhWndFrmain,WM_EXAM,0,(LPARAM)&sTemp);//ConhWndFrmain是VB窗口句柄
}
.def
LIBRARY PLCProcess
DESCRIPTION 'A C++ dll that can be called from VB'
EXPORTS
mConSendExample
模块中
Public Declare Sub mConSendExample Lib _
"D:\公司软件目录\软件\耐压爆破\标准版\TestPilot_PRB_PLC_ST\PLCProcess.dll" () '例子
调用
mConSendExample
[解决办法]
C++ dll实现dllmain没
[解决办法]
另外,注意码制的使用
别多字节和Unicode互相调用,不然怎么挂的都不知道