about dll problem,thank:)
-
about dll problem,thank:) i have two file a static dll file ,another static Exe file i think Exe call List Class in dll,but.......... ************************static dll****************************** <<<<>>>>>>> #pragma once class AFX_EXT_CLASS List:public CListCtrl { public: __declspec(dllexport) List(); __declspec(dllexport) ~List(); __declspec(dllexport) void CMCreate(CWnd *pWnd); DECLARE_MESSAGE_MAP(); public: __declspec(dllexport) afx_msg void OnNMClick(NMHDR *pNMHDR, LRESULT *pResult); }; <<<<<>>>>>>>> #include "Stdafx.h" #include "List.h" List::List() {} List::~List() {} BEGIN_MESSAGE_MAP(List,CListCtrl) ON_NOTIFY_REFLECT(NM_CLICK, &List::OnNMClick) END_MESSAGE_MAP() void List::OnNMClick(NMHDR *pNMHDR, LRESULT *pResult) { AfxMessageBox(_T("OK")); *pResult = 0; } void List::CMCreate(CWnd *pWnd) { this->Create(WS_VISIBLE | WS_BORDER|SS_NOTIFY | WS_TABSTOP | WS_CHILD | LVS_ALIGNTOP | LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_OWNERDRAWFIXED, CRect(20, 20, 800, 200), pWnd, 123); } *************************Exe************************ List *m_pList; m_pList=new List(); m_pList->CMCreate(this); why ,i Click m_pList not show "ok"??? my english is not good,sorry :( thank you:)
-
about dll problem,thank:) i have two file a static dll file ,another static Exe file i think Exe call List Class in dll,but.......... ************************static dll****************************** <<<<>>>>>>> #pragma once class AFX_EXT_CLASS List:public CListCtrl { public: __declspec(dllexport) List(); __declspec(dllexport) ~List(); __declspec(dllexport) void CMCreate(CWnd *pWnd); DECLARE_MESSAGE_MAP(); public: __declspec(dllexport) afx_msg void OnNMClick(NMHDR *pNMHDR, LRESULT *pResult); }; <<<<<>>>>>>>> #include "Stdafx.h" #include "List.h" List::List() {} List::~List() {} BEGIN_MESSAGE_MAP(List,CListCtrl) ON_NOTIFY_REFLECT(NM_CLICK, &List::OnNMClick) END_MESSAGE_MAP() void List::OnNMClick(NMHDR *pNMHDR, LRESULT *pResult) { AfxMessageBox(_T("OK")); *pResult = 0; } void List::CMCreate(CWnd *pWnd) { this->Create(WS_VISIBLE | WS_BORDER|SS_NOTIFY | WS_TABSTOP | WS_CHILD | LVS_ALIGNTOP | LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_OWNERDRAWFIXED, CRect(20, 20, 800, 200), pWnd, 123); } *************************Exe************************ List *m_pList; m_pList=new List(); m_pList->CMCreate(this); why ,i Click m_pList not show "ok"??? my english is not good,sorry :( thank you:)
What happens when you click ok
WhiteSky
-
about dll problem,thank:) i have two file a static dll file ,another static Exe file i think Exe call List Class in dll,but.......... ************************static dll****************************** <<<<>>>>>>> #pragma once class AFX_EXT_CLASS List:public CListCtrl { public: __declspec(dllexport) List(); __declspec(dllexport) ~List(); __declspec(dllexport) void CMCreate(CWnd *pWnd); DECLARE_MESSAGE_MAP(); public: __declspec(dllexport) afx_msg void OnNMClick(NMHDR *pNMHDR, LRESULT *pResult); }; <<<<<>>>>>>>> #include "Stdafx.h" #include "List.h" List::List() {} List::~List() {} BEGIN_MESSAGE_MAP(List,CListCtrl) ON_NOTIFY_REFLECT(NM_CLICK, &List::OnNMClick) END_MESSAGE_MAP() void List::OnNMClick(NMHDR *pNMHDR, LRESULT *pResult) { AfxMessageBox(_T("OK")); *pResult = 0; } void List::CMCreate(CWnd *pWnd) { this->Create(WS_VISIBLE | WS_BORDER|SS_NOTIFY | WS_TABSTOP | WS_CHILD | LVS_ALIGNTOP | LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_OWNERDRAWFIXED, CRect(20, 20, 800, 200), pWnd, 123); } *************************Exe************************ List *m_pList; m_pList=new List(); m_pList->CMCreate(this); why ,i Click m_pList not show "ok"??? my english is not good,sorry :( thank you:)
rxgmoral wrote:
void List::CMCreate(CWnd *pWnd) { this->Create(WS_VISIBLE | WS_BORDER|SS_NOTIFY | WS_TABSTOP | WS_CHILD | LVS_ALIGNTOP | LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_OWNERDRAWFIXED, CRect(20, 20, 800, 200), pWnd, 123); }
try to make BreakPoint here! and debug through it
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief And You