Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. dll problem,help me:)

dll problem,help me:)

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++comquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rxgmoral
    wrote on last edited by
    #1

    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 :)

    Blog: http://360.yahoo.com/rxgmoral

    T B H 3 Replies Last reply
    0
    • R rxgmoral

      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 :)

      Blog: http://360.yahoo.com/rxgmoral

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      rxgmoral wrote:

      error why????

      1. 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

      [VisualCalc 3.0][Flags Beginner's Guide]

      1 Reply Last reply
      0
      • R rxgmoral

        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 :)

        Blog: http://360.yahoo.com/rxgmoral

        B Offline
        B Offline
        benjymous
        wrote on last edited by
        #3

        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!

        1 Reply Last reply
        0
        • R rxgmoral

          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 :)

          Blog: http://360.yahoo.com/rxgmoral

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          What problems?


          WhiteSky


          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups