Click here to Skip to main content
15,900,254 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralProblems with LPRECT.. Pin
__Cerb29-Nov-03 13:54
__Cerb29-Nov-03 13:54 
GeneralRe: Problems with LPRECT.. Pin
Bo Hunter29-Nov-03 14:05
Bo Hunter29-Nov-03 14:05 
GeneralRe: Problems with LPRECT.. Pin
Michael Dunn29-Nov-03 14:26
sitebuilderMichael Dunn29-Nov-03 14:26 
GeneralRe: Problems with LPRECT.. Pin
Gareth Johnson30-Nov-03 8:54
sussGareth Johnson30-Nov-03 8:54 
QuestionHow to get "current" window handle ? Pin
legrillon29-Nov-03 13:42
legrillon29-Nov-03 13:42 
AnswerRe: How to get "current" window handle ? Pin
Michael Dunn29-Nov-03 14:29
sitebuilderMichael Dunn29-Nov-03 14:29 
GeneralRe: How to get "current" window handle ? Pin
legrillon1-Dec-03 9:36
legrillon1-Dec-03 9:36 
GeneralRefreshBoundData behaves strange !! Pin
Hesham Amin29-Nov-03 9:01
Hesham Amin29-Nov-03 9:01 
Hi..
I used the ADO data bound Dialog wizard to use an access DB table (ID:Autonumber , title:text , description:MEMO)

this code adds a new record:

UpdateData();

_variant_t varIndex;
_variant_t varVal;

try
{
    m_pRs->AddNew();
    varIndex.vt=VT_I4;
    varIndex.lVal=1;
    varVal.vt=VT_BSTR;
    varVal.bstrVal=m_strDlgTitle.AllocSysString();

    m_pRs->Fields->GetItem(varIndex)->PutValue(varVal);

    varIndex.lVal=2;
    ::SysFreeString(varVal.bstrVal);
    varVal.bstrVal=m_strDlgDescription.AllocSysString();
    m_pRs->Fields->GetItem(&varIndex)->PutValue(&varVal);
    ::SysFreeString(varVal.bstrVal);

    vtMissing;
    m_pRs->Update(vtMissing,vtMissing);

    RefreshBoundData();
}
catch(_com_error &e)
{
    AfxMessageBox(e.Description());
}
::SysFreeString(varVal.bstrVal);


the code works fine (the new data shows up in the access DB)
the problem is :
when i call RefreshBoundData the dialog refreshes only the textox that shows the ID (autonumber) while other fields (text,memo) appear empty ..
the code of RefreshBoundData is :

void CRsCgDlgCat::RefreshBoundData()
{
	if (adFldOK == lIDStatus)
		m_lDlgID = m_lID;
	else
		m_lDlgID = 0;
	if (adFldOK == lTitleStatus)
		m_strDlgTitle = m_wszTitle;
	else
		m_strDlgTitle = _T("");
	if (adFldOK == lDescriptionStatus)
		m_strDlgDescription = m_wszDescription;
	else
		m_strDlgDescription = _T("");

	UpdateData(FALSE);
}

i found that the problem is : lTitleStatus,lDescriptionStatus are equal to 3 (means that they are nulls !!!)

can u help ?
please send any Qs if my post is not clear
GeneralC help! Pin
Anonymous29-Nov-03 8:53
Anonymous29-Nov-03 8:53 
GeneralRe: C help! Pin
JWood29-Nov-03 18:36
JWood29-Nov-03 18:36 
GeneralRe: C help! Pin
Anonymous30-Nov-03 10:19
Anonymous30-Nov-03 10:19 
GeneralWindowFromPoint() Pin
__Cerb29-Nov-03 7:45
__Cerb29-Nov-03 7:45 
GeneralRe: WindowFromPoint() Pin
DaFrawg29-Nov-03 9:13
DaFrawg29-Nov-03 9:13 
GeneralRe: WindowFromPoint() Pin
Michael Dunn29-Nov-03 9:14
sitebuilderMichael Dunn29-Nov-03 9:14 
GeneralARRGGHHH stupid CryptoAPI (CryptEncrypt) Pin
(Steven Hicks)n+129-Nov-03 7:24
(Steven Hicks)n+129-Nov-03 7:24 
GeneralSetWindowsHookEx and HINSTANCE; Pin
Bo Hunter29-Nov-03 6:39
Bo Hunter29-Nov-03 6:39 
GeneralRe: SetWindowsHookEx and HINSTANCE; Pin
Anonymous29-Nov-03 7:14
Anonymous29-Nov-03 7:14 
GeneralHelp with going through text file. Pin
Snyp29-Nov-03 6:28
Snyp29-Nov-03 6:28 
GeneralRe: Help with going through text file. Pin
BaldwinMartin29-Nov-03 19:29
BaldwinMartin29-Nov-03 19:29 
GeneralRe: Help with going through text file. Pin
Snyp30-Nov-03 7:08
Snyp30-Nov-03 7:08 
GeneralRe: Help with going through text file. Pin
BaldwinMartin30-Nov-03 19:48
BaldwinMartin30-Nov-03 19:48 
QuestionMFC multiple documents? Pin
IndrekSnt29-Nov-03 3:16
IndrekSnt29-Nov-03 3:16 
AnswerRe: MFC multiple documents? Pin
Anonymous29-Nov-03 5:21
Anonymous29-Nov-03 5:21 
GeneralRe: MFC multiple documents? Pin
IndrekSnt29-Nov-03 6:30
IndrekSnt29-Nov-03 6:30 
GeneralRe: MFC multiple documents? Pin
l a u r e n29-Nov-03 13:32
l a u r e n29-Nov-03 13:32 

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.