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