473,320 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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====================
<<<<<<<<<<ListCtrl.h>>>>>>>>>>>>>>>
#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);
};

<<<<<<<<<<<ListCtrl.Cpp>>>>>>>>>>>
#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

<<<<<<<<<<<TestDlg.h>>>>>>>>>>>>
#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;
};

<<<<<<<<<<<<<<<TestDlg.Cpp>>>>>>>>>>
#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
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Oct 31 '06 #1
1 1193

"rxgmoral" <rx*************@mail.codecomments.comwrote in message
news:rx*************@mail.codecomments.com...
>
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
I think MFC extension dlls must use MFC in a Shared DLL
Oct 31 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: kantg | last post by:
Dear all, I am trying to install the oracle 9i on my laptop. I am not able to connect the sqlplus to the database. it says tns name resolution error or no listener. I configured using net...
0
by: guyWITHproblem | last post by:
I am building User Control. I override onpaint event and put this in it e.graphic.drawimage(etc.....) I want my control have watermark on it. Onpaint done the job but when i scroll my control,...
4
by: Madhu Gopinathan | last post by:
Hi All, I am faced with a horrible hang problem. I have a COM exe server that executes some tasks. The task execution manager is a thread that manages the pool of threads, which is 4 per processor....
8
by: Dhananjay | last post by:
hello everyone Do you have any information how to generate a tool using .net which is used to translate the web page contents to html format. Plz reply me asap Thanks in advance Dhananjay
1
by: sonasiva | last post by:
HAI all i have stuffed some comment from database within teaxtarea, problem is text are displaying as cobination of data and html tag like <br> (data and <br>) like as follows this is the...
0
by: kaushalbhavsar2002 | last post by:
Hello every one, I m designed and formatted crystal report when i m transfer to client machine the alignment was lost... so how can i lock all the field in crystal report, so i the problem will...
3
by: vikassawant | last post by:
hi, My problem is some what crazy for me. Let's see, I declare one java file named as, test1.java. In which i designed required GUI for project i.e 8 combobox,two buttons,etc....
0
by: harshakusam | last post by:
Hi All, In my python script i use to run some oracle queries for this i require a library to connect to oracle which is cx_Oracle. When we were using 9i(oracle).. my script was running fine.....
1
by: lion cave | last post by:
Hello! Good day! I have a problem regarding to my MSSQL db. I have a database name named db1 with huge structure of tables and has a series of data also. I would like to copy the db1 to the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.