Click here to Skip to main content
15,920,956 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questiondata problem Pin
p_10-May-07 0:06
p_10-May-07 0:06 
Questionmaking windows service with wxwidget Pin
seneralex9-May-07 23:46
seneralex9-May-07 23:46 
AnswerRe: making windows service with wxwidget Pin
ThatsAlok16-May-07 21:15
ThatsAlok16-May-07 21:15 
AnswerRe: making windows service with wxwidget Pin
Priyank Bolia16-May-07 21:53
Priyank Bolia16-May-07 21:53 
QuestionReporting tool Pin
Piyush Thacker9-May-07 23:33
Piyush Thacker9-May-07 23:33 
JokeRe: Reporting tool Pin
Programm3r9-May-07 23:40
Programm3r9-May-07 23:40 
GeneralRe: Reporting tool Pin
BadJerry10-May-07 1:36
BadJerry10-May-07 1:36 
QuestionLinker error using dll? Pin
$uresh $hanmugam9-May-07 22:14
$uresh $hanmugam9-May-07 22:14 
Hi all,
I has been created one MFC extension dll called SRecordset.dll,which has been one .h file and one .cpp file

my dll .h file..

#pragma once<br />
#include afxdb.h<br />
<br />
<br />
class AFX_EXT_CLASS SRecordset : public CObject<br />
{<br />
DECLARE_SERIAL(SRecordset)<br />
<br />
<br />
public:<br />
SRecordset(void);<br />
<br />
public:<br />
~SRecordset(void);<br />
<br />
protected:<br />
CStringArray saDataContainer;<br />
short iNumFldCount;<br />
long iNumRec;<br />
int iRecCount;<br />
int iTotalSize;<br />
int iRecordState;<br />
int iLocalIndex;<br />
public:<br />
BOOL SSOpen(CDatabase &dbConnectedObj,CString sQuery);<br />
BOOL SSIsOpen(void);<br />
void SSClose(void);<br />
public:<br />
BOOL SSIsBOF(void);<br />
BOOL SSIsEOF(void);<br />
public:<br />
void SSGetFieldValue(int iIndex,CString &FldValue);<br />
short SSGetFieldCount(void);<br />
long SSGetRecordCount(void);<br />
long SSGetCurrentRecordCount(void);<br />
public:<br />
void SSMoveNext(void);<br />
void SSMovePrevious(void);<br />
void SSMoveFirst(void);<br />
void SSMoveLast(void);<br />
public:<br />
virtual void Serialize(CArchive& ar);<br />
};



I has been created my dll successfully. But, it won't support to the client application,it will be thrown only one linker error, when i call rather the SSOpen(CDatabase &dbConnectedObj,CString sQuery) function only, not other function calls from my above the class during the runtime.

Here the part of code from my client app...

void CtestingDlg::OnBnClickedOk()<br />
{<br />
// TODO: Add your control notification handler code here<br />
<br />
<br />
CDatabase db;<br />
CString sIp,sDb,sPwd,sConn,sPort,sUn;<br />
sIp="192.168.2.17";<br />
sPort="5432";<br />
sPwd="fasp";<br />
<br />
<br />
try<br />
{<br />
sConn = "DRIVER={PostgreSQL ANSI};SERVER=" + sIp + ";port=" +<br />
sPort + ";DATABASE=" + sPwd + ";UID=" + sPwd + "WD=" + sPwd + ";";<br />
db.OpenEx(sConn);<br />
AfxMessageBox("Success");<br />
}<br />
catch(CDBException *e)<br />
{<br />
MessageBox("Database Connection Refused."+e->m_strError,"DataBase<br />
Connection Error",MB_OK|MB_ICONERROR);<br />
e->Delete();<br />
<br />
}<br />
<br />
<br />
SRecordset set1;<br />
<br />
set1.SSOpen(db,"select name from master;");<br />
set1.SSGetFieldCount();<br />
set1.SSGetRecordCount();<br />
set1.SSClose();<br />
<br />
OnOK();<br />
}


where set1.SSOpen(db,"select name from master;"); is the problem

Error is.....

testingDlg.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __thiscall SRecordset::SSOpen(class CDatabase &,class ATL::CStringT > >)" (__imp_?SSOpen@SRecordset@@QAEHAAVCDatabase@@V?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z) referenced in function __catch$?OnBnClickedOk@CtestingDlg@@QAEXXZ$0

please note that my class is derived from CObject class meanwhile CDatabase is also derived from CObject class...i think may be this is the reason for my problem?
please help me!
AnswerRe: Linker error using dll? Pin
Cedric Moonen9-May-07 22:21
Cedric Moonen9-May-07 22:21 
GeneralRe: Linker error using dll? Pin
$uresh $hanmugam9-May-07 22:28
$uresh $hanmugam9-May-07 22:28 
GeneralRe: Linker error using dll? Pin
Cedric Moonen9-May-07 22:32
Cedric Moonen9-May-07 22:32 
GeneralRe: Linker error using dll? [modified] Pin
$uresh $hanmugam9-May-07 22:50
$uresh $hanmugam9-May-07 22:50 
QuestionXMLHTTP error 12019 Pin
Andy H9-May-07 22:12
Andy H9-May-07 22:12 
AnswerRe: XMLHTTP error 12019 Pin
Andy H10-May-07 0:26
Andy H10-May-07 0:26 
GeneralRe: XMLHTTP error 12019 Pin
Andy H10-May-07 1:06
Andy H10-May-07 1:06 
QuestionCancel dialog Pin
deeps_cute9-May-07 22:11
deeps_cute9-May-07 22:11 
AnswerRe: Cancel dialog Pin
Rajesh R Subramanian9-May-07 22:18
professionalRajesh R Subramanian9-May-07 22:18 
AnswerRe: Cancel dialog Pin
Hamid_RT9-May-07 22:25
Hamid_RT9-May-07 22:25 
GeneralRe: Cancel dialog Pin
deeps_cute9-May-07 23:14
deeps_cute9-May-07 23:14 
QuestionRe: Cancel dialog Pin
Hamid_RT10-May-07 2:16
Hamid_RT10-May-07 2:16 
GeneralRe: Cancel dialog Pin
Nelek13-May-07 19:48
protectorNelek13-May-07 19:48 
AnswerRe: Cancel dialog Pin
Nelek9-May-07 23:14
protectorNelek9-May-07 23:14 
GeneralRe: Cancel dialog Pin
deeps_cute10-May-07 0:20
deeps_cute10-May-07 0:20 
GeneralRe: Cancel dialog Pin
ThatsAlok16-May-07 21:13
ThatsAlok16-May-07 21:13 
QuestionRe: Cancel dialog Pin
David Crow10-May-07 2:00
David Crow10-May-07 2:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.