Click here to Skip to main content
15,915,319 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: AVIFileOpen trouble Pin
R.A.V.E.23-Apr-07 3:05
R.A.V.E.23-Apr-07 3:05 
GeneralRe: AVIFileOpen trouble Pin
Mark Salsbery23-Apr-07 4:52
Mark Salsbery23-Apr-07 4:52 
Questionright way to implement a popup window Pin
Jim Crafton20-Apr-07 8:43
Jim Crafton20-Apr-07 8:43 
QuestionSqlConnection does't work with CString????? Pin
Romiks20-Apr-07 8:27
Romiks20-Apr-07 8:27 
AnswerRe: SqlConnection does't work with CString????? Pin
Mark Salsbery20-Apr-07 9:19
Mark Salsbery20-Apr-07 9:19 
QuestionTrouble linking to SQL DB in VC++ Pin
@largeinsd20-Apr-07 8:14
@largeinsd20-Apr-07 8:14 
AnswerRe: Trouble linking to SQL DB in VC++ Pin
Mark Salsbery20-Apr-07 8:25
Mark Salsbery20-Apr-07 8:25 
GeneralRe: Trouble linking to SQL DB in VC++ Pin
@largeinsd20-Apr-07 8:40
@largeinsd20-Apr-07 8:40 
ok, well ... that shows you what i know! thanks
for your help, much appreciated.

i'm still learning the lingo: i have "implemented the class" if that means that i created both a header and implementation
file, and added them to the project.

note that the error message points to the line
directly before the IMPLEMENT_DYNAMIC statement
in the implementation file.

here is the text from the header file, for example:

////////////////////////////////////////////////////////

#include "StdAfx.h"
#include "SNU.h"
#include "BaseRecordsetOdbc.h"

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

// JF created to StartTime & EndTime validation

class CSetspQueryForTimeOverlap : public CBaseRecordset
{
public:
CSetspQueryForTimeOverlap(CDatabase* pDatabase = NULL);
DECLARE_DYNAMIC(CSetspQueryTimeOverlap)

// Field data
long m_PaymentID;

// Param data
long m_paramClientIDParam;
COleDateTime m_paramStartTimeParam;
COleDateTime m_paramEndTimeParam;


BOOL Run(long ClientID, COleDateTime StartTime, COleDateTime EndTime);

// Overrides
virtual CString GetDefaultSQL(); // Default SQL for Recordset
virtual void DoFieldExchange(CFieldExchange* pFX); // RFX support

// Implementation
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
};

///////////////////////////////////////////////////////////

and here is the code from the implementation file:

///////////////////////////////////////////////////////////

#include "StdAfx.h"
#include "SetspQueryForTimeOverlap.h"
#include "SNU.h"
#include "BaseRecordsetOdbc.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

IMPLEMENT_DYNAMIC(CSetspQueryForTimeOverlap, CBaseRecordset)

CSetspQueryForTimeOverlap::CSetspQueryForTimeOverlap(CDatabase* pdb)
: CBaseRecordset(gGetApp()->m_pDBPool, CDBConnectionPool::RecTypeSP)
{
// Field Init
m_PaymentID = 0;
m_nFields = 1;

// Param Init
m_paramClientIDParam = 0;
m_paramStartTimeParam = COleDateTime(1972,1,22,0,0,0); // Initialize to "dummy value" - my birfday! JF
m_paramEndTimeParam = COleDateTime(1972,1,22,0,0,0);
m_nParams = 3;

m_nDefaultType = snapshot;
}

CString CSetspQueryForTimeOverlap::GetDefaultSQL()
{
return _T("{CALL spQueryTimeOverlap (?,?,?)}");
}

void CSetspQueryForTimeOverlap::DoFieldExchange(CFieldExchange* pFX)
{
// RFX field mapping
pFX->SetFieldType(CFieldExchange::outputColumn);
RFX_Long(pFX, _T("[PaymentID]"), m_PaymentID);

// RFX input param mapping
pFX->SetFieldType(CFieldExchange::inputParam);
RFX_Long(pFX, _T("[@paramClientID]"), m_paramClientIDParam);
RFX_Date(pFX, _T("[@paramStartTime]"), m_paramStartTimeParam);
RFX_Date(pFX, _T("[@paramEndTime]"), m_paramEndTimeParam);
}

#ifdef _DEBUG
void CSetspQueryForTimeOverlap::AssertValid() const
{
CBaseRecordset::AssertValid();
}

void CSetspQueryForTimeOverlap::Dump(CDumpContext& dc) const
{
CBaseRecordset::Dump(dc);
}
#endif //_DEBUG

BOOL CSetspQueryForTimeOverlap::Run(long ClientID, COleDateTime StartTime, COleDateTime EndTime)
{
m_paramClientIDParam = ClientID;
m_paramStartTimeParam = StartTime;
m_paramEndTimeParam = EndTime;

return DoRequery();
}

////////////////////////////////////////////////////////

ok, sincere thanks for the help!

GeneralRe: Trouble linking to SQL DB in VC++ Pin
Mark Salsbery20-Apr-07 9:01
Mark Salsbery20-Apr-07 9:01 
GeneralRe: Trouble linking to SQL DB in VC++ Pin
@largeinsd20-Apr-07 9:55
@largeinsd20-Apr-07 9:55 
GeneralRe: Trouble linking to SQL DB in VC++ Pin
Mark Salsbery20-Apr-07 10:02
Mark Salsbery20-Apr-07 10:02 
Questionhoe design control for C#.net ? Pin
hamid_m20-Apr-07 8:04
hamid_m20-Apr-07 8:04 
QuestionProblems moving date and time control on MFC dialog [modified] Pin
Barry True20-Apr-07 7:19
Barry True20-Apr-07 7:19 
AnswerRe: Problems moving date and time control on MFC dialog Pin
Barry True26-Apr-07 11:41
Barry True26-Apr-07 11:41 
Questionhtml and C++ Pin
Tully200320-Apr-07 6:06
Tully200320-Apr-07 6:06 
QuestionAnybody done any Speex development? Pin
Heavenword120-Apr-07 5:28
Heavenword120-Apr-07 5:28 
QuestionUsing UI-Thread Pin
CDRAIN20-Apr-07 4:58
CDRAIN20-Apr-07 4:58 
Questionstrcpy - Doing something wrong ?? Pin
Programm3r20-Apr-07 4:12
Programm3r20-Apr-07 4:12 
AnswerRe: strcpy - Doing something wrong ?? Pin
Programm3r20-Apr-07 4:17
Programm3r20-Apr-07 4:17 
GeneralRe: strcpy - Doing something wrong ?? Pin
Mark Salsbery20-Apr-07 7:43
Mark Salsbery20-Apr-07 7:43 
AnswerRe: strcpy - Doing something wrong ?? Pin
Michael Dunn20-Apr-07 7:01
sitebuilderMichael Dunn20-Apr-07 7:01 
AnswerRe: strcpy - Doing something wrong ?? Pin
krmed20-Apr-07 10:10
krmed20-Apr-07 10:10 
GeneralRe: strcpy - Doing something wrong ?? Pin
Mark Salsbery20-Apr-07 10:26
Mark Salsbery20-Apr-07 10:26 
GeneralRe: strcpy - Doing something wrong ?? Pin
krmed20-Apr-07 10:29
krmed20-Apr-07 10:29 
GeneralRe: strcpy - Doing something wrong ?? Pin
Michael Dunn20-Apr-07 16:39
sitebuilderMichael Dunn20-Apr-07 16:39 

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.