Click here to Skip to main content
15,893,337 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How do you const your references? Pin
Stefan_Lang6-Oct-11 22:07
Stefan_Lang6-Oct-11 22:07 
AnswerRe: How do you const your references? Pin
«_Superman_»6-Oct-11 6:05
professional«_Superman_»6-Oct-11 6:05 
QuestionPostMessage with WPARAM does not work Pin
Vaclav_5-Oct-11 17:43
Vaclav_5-Oct-11 17:43 
AnswerRe: PostMessage with WPARAM does not work Pin
Richard MacCutchan5-Oct-11 21:39
mveRichard MacCutchan5-Oct-11 21:39 
AnswerRe: You can't simulate keyboard input with PostMessage Pin
Software_Developer5-Oct-11 21:50
Software_Developer5-Oct-11 21:50 
AnswerRe: PostMessage with WPARAM does not work Pin
Vaclav_5-Oct-11 23:21
Vaclav_5-Oct-11 23:21 
GeneralRe: PostMessage with WPARAM does not work Pin
enhzflep6-Oct-11 1:10
enhzflep6-Oct-11 1:10 
QuestionHi there all again! This time with an improvement! (and more clear question about C++ ADO) :) Pin
symeramon5-Oct-11 5:21
symeramon5-Oct-11 5:21 
C++
RecordsetPtr rsUrun;
rsUrun.CreateInstance(__uuidof(Recordset));
	try{

_variant_t Holder;

CString cQry=_T("");
CString cTmp=_T("");
_stUrun stTmp;
vUrun.clear();

cQry=_T("Select * From urun order by adi");
//AfxMessageBox(cQry);
rsUrun->Open(_variant_t(cQry),AdoTest.GetInterfacePtr(),adOpenDynamic,adLockOptimistic,adCmdText);
CStringArray caTmp;
int nPs=0;
while(!rsUrun->adoEOF)
{
stTmp.cUrunAd=_T("");
stTmp.dBirimf=0;
stTmp.nDBID=0;

	Holder = rsUrun->GetCollect("urunid");//id
	if(Holder.vt!=VT_NULL) stTmp.nDBID=atoi((char*)_bstr_t(Holder));

	Holder = rsUrun->GetCollect("adi");//name
	if(Holder.vt!=VT_NULL) stTmp.cUrunAd=(char*)_bstr_t(Holder);

	Holder = rsUrun->GetCollect("birimf");//cost
	if(Holder.vt!=VT_NULL) stTmp.dBirimf=atof((char*)_bstr_t(Holder));

	vUrun.push_back(stTmp);
	CString adi = rsUrun->GetCollect("adi");
	listbo1.AddString(_T(adi));
	int gfujf = listbo1.GetItemData(listbo1.GetCount()-1);
rsUrun->MoveNext();


SO here is the code, could you please help me on how can I get the listbox item's id in order to use it in an update query?? Here is my button below, I did some work on it but seems no good Frown | :(

C++
void CTestADSSQLDlg::OnBnClickedButton1()
{
	_RecordsetPtr rsUrun;
rsUrun.CreateInstance(__uuidof(Recordset));
CString cQry=_T("Update urun set adi='%s' where urunid='%d'", editbo1;

rsUrun->Open(_variant_t(cQry),AdoTest.GetInterfacePtr(),adOpenDynamic,adLockOptimistic,adCmdText);
}

AnswerRe: Hi there all again! This time with an improvement! (and more clear question about C++ ADO) :) Pin
David Crow5-Oct-11 8:10
David Crow5-Oct-11 8:10 
GeneralRe: Hi there all again! This time with an improvement! (and more clear question about C++ ADO) :) Pin
symeramon6-Oct-11 0:47
symeramon6-Oct-11 0:47 
GeneralRe: Hi there all again! This time with an improvement! (and more clear question about C++ ADO) :) Pin
David Crow6-Oct-11 2:55
David Crow6-Oct-11 2:55 
GeneralRe: Hi there all again! This time with an improvement! (and more clear question about C++ ADO) :) Pin
symeramon7-Oct-11 5:33
symeramon7-Oct-11 5:33 
QuestionMFC usage Pin
mysmax5-Oct-11 2:01
mysmax5-Oct-11 2:01 
AnswerRe: MFC usage Pin
Albert Holguin5-Oct-11 2:53
professionalAlbert Holguin5-Oct-11 2:53 
GeneralRe: MFC usage Pin
Stefan_Lang6-Oct-11 1:32
Stefan_Lang6-Oct-11 1:32 
AnswerRe: MFC usage Pin
Software_Developer5-Oct-11 3:11
Software_Developer5-Oct-11 3:11 
GeneralRe: MFC usage Pin
Richard MacCutchan5-Oct-11 4:42
mveRichard MacCutchan5-Oct-11 4:42 
GeneralRe: MFC usage Pin
Software_Developer5-Oct-11 5:13
Software_Developer5-Oct-11 5:13 
QuestionC++ Providers Pin
rupeshkp7285-Oct-11 1:36
rupeshkp7285-Oct-11 1:36 
AnswerRe: C++ Providers Pin
_AnsHUMAN_ 5-Oct-11 1:52
_AnsHUMAN_ 5-Oct-11 1:52 
GeneralRe: C++ Providers Pin
rupeshkp7285-Oct-11 1:59
rupeshkp7285-Oct-11 1:59 
AnswerRe: C++ Providers Pin
Software_Developer5-Oct-11 3:31
Software_Developer5-Oct-11 3:31 
GeneralRe: C++ Providers Pin
rupeshkp7285-Oct-11 4:39
rupeshkp7285-Oct-11 4:39 
QuestionHow to Copy static array to dynamic array Pin
002comp4-Oct-11 23:34
002comp4-Oct-11 23:34 
AnswerRe: How to Copy static array to dynamic array Pin
_AnsHUMAN_ 5-Oct-11 1:19
_AnsHUMAN_ 5-Oct-11 1:19 

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.