dll problem,help me:)
-
dll problem,help me:) i create dll project ,the dll is Use MFC in a Static Library i hope exe call ListCtrl class from dll ==================DLL==================== <<<<<<<<<>>>>>>>>>>>>>> #pragma once class AFX_EXT_CLASS ListCtrl :public CListCtrl { public: __declspec(dllexport) ListCtrl(); __declspec(dllexport) ~ListCtrl(); public: DECLARE_MESSAGE_MAP(); public: afx_msg void OnNMClick(NMHDR *pNMHDR, LRESULT *pResult); }; <<<<<<<<<<>>>>>>>>>> #include "Stdafx.h" #include "ListCtrl.h" ListCtrl::ListCtrl() {} ListCtrl::~ListCtrl() {} BEGIN_MESSAGE_MAP(ListCtrl,CListCtrl) ON_NOTIFY_REFLECT(NM_CLICK, &ListCtrl::OnNMClick) END_MESSAGE_MAP() void ListCtrl::OnNMClick(NMHDR *pNMHDR, LRESULT *pResult) { AfxMessageBox(_T("OK")); *pResult = 0; } =====================EXE============================ i Create Exe,the exe is Use MFC in a Static Library <<<<<<<<<<>>>>>>>>>>> #pragma comment(lib,"Dll.lib") #include "ListCtrl.h" class TestDlg : public CDialog { DECLARE_DYNAMIC(TestDlg) public: TestDlg(CWnd* pParent = NULL); // standard constructor virtual ~TestDlg(); enum { IDD = IDD_DIALOG1 }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support DECLARE_MESSAGE_MAP() ListCtrl m_ListCtrl; }; <<<<<<<<<<<<<<>>>>>>>>> #include "stdafx.h" #include "Test.h" #include "TestDlg.h" IMPLEMENT_DYNAMIC(TestDlg, CDialog) TestDlg::TestDlg(CWnd* pParent /*=NULL*/) : CDialog(TestDlg::IDD, pParent) {} TestDlg::~TestDlg() {} void TestDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); DDX_Control(pDX, IDC_LIST1, m_ListCtrl); } BEGIN_MESSAGE_MAP(TestDlg, CDialog) ON_BN_CLICKED(IDOK, &TestDlg::OnBnClickedOk) END_MESSAGE_MAP() ====================== the exe project call ListCtrl from dll project Mouse click the m_ListCtrl window,error why???? help me,thank you :)
-
dll problem,help me:) i create dll project ,the dll is Use MFC in a Static Library i hope exe call ListCtrl class from dll ==================DLL==================== <<<<<<<<<>>>>>>>>>>>>>> #pragma once class AFX_EXT_CLASS ListCtrl :public CListCtrl { public: __declspec(dllexport) ListCtrl(); __declspec(dllexport) ~ListCtrl(); public: DECLARE_MESSAGE_MAP(); public: afx_msg void OnNMClick(NMHDR *pNMHDR, LRESULT *pResult); }; <<<<<<<<<<>>>>>>>>>> #include "Stdafx.h" #include "ListCtrl.h" ListCtrl::ListCtrl() {} ListCtrl::~ListCtrl() {} BEGIN_MESSAGE_MAP(ListCtrl,CListCtrl) ON_NOTIFY_REFLECT(NM_CLICK, &ListCtrl::OnNMClick) END_MESSAGE_MAP() void ListCtrl::OnNMClick(NMHDR *pNMHDR, LRESULT *pResult) { AfxMessageBox(_T("OK")); *pResult = 0; } =====================EXE============================ i Create Exe,the exe is Use MFC in a Static Library <<<<<<<<<<>>>>>>>>>>> #pragma comment(lib,"Dll.lib") #include "ListCtrl.h" class TestDlg : public CDialog { DECLARE_DYNAMIC(TestDlg) public: TestDlg(CWnd* pParent = NULL); // standard constructor virtual ~TestDlg(); enum { IDD = IDD_DIALOG1 }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support DECLARE_MESSAGE_MAP() ListCtrl m_ListCtrl; }; <<<<<<<<<<<<<<>>>>>>>>> #include "stdafx.h" #include "Test.h" #include "TestDlg.h" IMPLEMENT_DYNAMIC(TestDlg, CDialog) TestDlg::TestDlg(CWnd* pParent /*=NULL*/) : CDialog(TestDlg::IDD, pParent) {} TestDlg::~TestDlg() {} void TestDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); DDX_Control(pDX, IDC_LIST1, m_ListCtrl); } BEGIN_MESSAGE_MAP(TestDlg, CDialog) ON_BN_CLICKED(IDOK, &TestDlg::OnBnClickedOk) END_MESSAGE_MAP() ====================== the exe project call ListCtrl from dll project Mouse click the m_ListCtrl window,error why???? help me,thank you :)
rxgmoral wrote:
error why????
- speak proper englisk 2) provide useful informations : What error message ? how exactly did it happen ?
You don't know where to start ? ask a good friend
-
dll problem,help me:) i create dll project ,the dll is Use MFC in a Static Library i hope exe call ListCtrl class from dll ==================DLL==================== <<<<<<<<<>>>>>>>>>>>>>> #pragma once class AFX_EXT_CLASS ListCtrl :public CListCtrl { public: __declspec(dllexport) ListCtrl(); __declspec(dllexport) ~ListCtrl(); public: DECLARE_MESSAGE_MAP(); public: afx_msg void OnNMClick(NMHDR *pNMHDR, LRESULT *pResult); }; <<<<<<<<<<>>>>>>>>>> #include "Stdafx.h" #include "ListCtrl.h" ListCtrl::ListCtrl() {} ListCtrl::~ListCtrl() {} BEGIN_MESSAGE_MAP(ListCtrl,CListCtrl) ON_NOTIFY_REFLECT(NM_CLICK, &ListCtrl::OnNMClick) END_MESSAGE_MAP() void ListCtrl::OnNMClick(NMHDR *pNMHDR, LRESULT *pResult) { AfxMessageBox(_T("OK")); *pResult = 0; } =====================EXE============================ i Create Exe,the exe is Use MFC in a Static Library <<<<<<<<<<>>>>>>>>>>> #pragma comment(lib,"Dll.lib") #include "ListCtrl.h" class TestDlg : public CDialog { DECLARE_DYNAMIC(TestDlg) public: TestDlg(CWnd* pParent = NULL); // standard constructor virtual ~TestDlg(); enum { IDD = IDD_DIALOG1 }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support DECLARE_MESSAGE_MAP() ListCtrl m_ListCtrl; }; <<<<<<<<<<<<<<>>>>>>>>> #include "stdafx.h" #include "Test.h" #include "TestDlg.h" IMPLEMENT_DYNAMIC(TestDlg, CDialog) TestDlg::TestDlg(CWnd* pParent /*=NULL*/) : CDialog(TestDlg::IDD, pParent) {} TestDlg::~TestDlg() {} void TestDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); DDX_Control(pDX, IDC_LIST1, m_ListCtrl); } BEGIN_MESSAGE_MAP(TestDlg, CDialog) ON_BN_CLICKED(IDOK, &TestDlg::OnBnClickedOk) END_MESSAGE_MAP() ====================== the exe project call ListCtrl from dll project Mouse click the m_ListCtrl window,error why???? help me,thank you :)
You asked the same question - please don't keep reposting the same question. You're probably not getting an answer as you don't really give much info. Today you're getting an error. What is the error? Have you tried stepping through in a debugger when you click your list control? What happens?
-- Help me! I'm turning into a grapefruit! Buzzwords!
-
dll problem,help me:) i create dll project ,the dll is Use MFC in a Static Library i hope exe call ListCtrl class from dll ==================DLL==================== <<<<<<<<<>>>>>>>>>>>>>> #pragma once class AFX_EXT_CLASS ListCtrl :public CListCtrl { public: __declspec(dllexport) ListCtrl(); __declspec(dllexport) ~ListCtrl(); public: DECLARE_MESSAGE_MAP(); public: afx_msg void OnNMClick(NMHDR *pNMHDR, LRESULT *pResult); }; <<<<<<<<<<>>>>>>>>>> #include "Stdafx.h" #include "ListCtrl.h" ListCtrl::ListCtrl() {} ListCtrl::~ListCtrl() {} BEGIN_MESSAGE_MAP(ListCtrl,CListCtrl) ON_NOTIFY_REFLECT(NM_CLICK, &ListCtrl::OnNMClick) END_MESSAGE_MAP() void ListCtrl::OnNMClick(NMHDR *pNMHDR, LRESULT *pResult) { AfxMessageBox(_T("OK")); *pResult = 0; } =====================EXE============================ i Create Exe,the exe is Use MFC in a Static Library <<<<<<<<<<>>>>>>>>>>> #pragma comment(lib,"Dll.lib") #include "ListCtrl.h" class TestDlg : public CDialog { DECLARE_DYNAMIC(TestDlg) public: TestDlg(CWnd* pParent = NULL); // standard constructor virtual ~TestDlg(); enum { IDD = IDD_DIALOG1 }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support DECLARE_MESSAGE_MAP() ListCtrl m_ListCtrl; }; <<<<<<<<<<<<<<>>>>>>>>> #include "stdafx.h" #include "Test.h" #include "TestDlg.h" IMPLEMENT_DYNAMIC(TestDlg, CDialog) TestDlg::TestDlg(CWnd* pParent /*=NULL*/) : CDialog(TestDlg::IDD, pParent) {} TestDlg::~TestDlg() {} void TestDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); DDX_Control(pDX, IDC_LIST1, m_ListCtrl); } BEGIN_MESSAGE_MAP(TestDlg, CDialog) ON_BN_CLICKED(IDOK, &TestDlg::OnBnClickedOk) END_MESSAGE_MAP() ====================== the exe project call ListCtrl from dll project Mouse click the m_ListCtrl window,error why???? help me,thank you :)
What problems?
WhiteSky