向dll中传参数是引起malloc错误
dll声明
extern "C" __declspec(dllexport) void ShowMap(char* szText)
dll调用
typedef void (FAR __cdecl *MAPDLL_SHOW) (char* szText);
typedef void (FAR __cdecl *MAPDLL_CLOSE) ();
MAPDLL_SHOW lpproc;
lpproc = (MAPDLL_SHOW)GetProcAddress (m_hmod,"ShowMap");
CString szText = m_mailItem.m_szBody;
LPTSTR lpsz =(LPTSTR)(LPCTSTR)szText;
lpproc(lpsz);
错误提示:
Unhandled exception at 0x10007c29 in OutlookStyleUI.exe: 0xC0000005: Access violation reading location 0x00000194.
把参数换成CString,CString&都不行