我试验了一下,没有什么问题
我的DLL:
extern "C"
_declspec(dllexport) BOOL AddStringToListBox(HWND hWndList,LPCTSTR pszText)
{
if(!hWndList) return FALSE;
::SendMessage(hWndList,LB_ADDSTRING,0,(LPARAM)pszText);
return TRUE;
}在程序中调用:
void CListProcDlg::OnAddstring() 
{
// TODO: Add your control notification handler code here
typedef BOOL (*DLLFUNC) (HWND,LPCTSTR);
DLLFUNC proc=(DLLFUNC)GetProcAddress(hInst,"AddStringToListBox"); HWND hwnd=::GetDlgItem(m_hWnd,IDC_LIST);
if(hwnd) (proc)(hwnd,TEXT("Add Me"));
}
没有出现什么问题.
你可能是其他地方出现了问题