Click here to Skip to main content
15,922,584 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Short cut key is not working properly Pin
Richard MacCutchan6-Oct-11 5:55
mveRichard MacCutchan6-Oct-11 5:55 
AnswerRe: Short cut key is not working properly Pin
PJ Arends7-Oct-11 11:31
professionalPJ Arends7-Oct-11 11:31 
QuestionResizing a WPF Window that is a child to a CView Pin
nadine123455-Oct-11 22:01
nadine123455-Oct-11 22:01 
AnswerRe: Resizing a WPF Window that is a child to a CView Pin
TheGreatAndPowerfulOz6-Oct-11 11:05
TheGreatAndPowerfulOz6-Oct-11 11:05 
GeneralRe: Resizing a WPF Window that is a child to a CView Pin
nadine123456-Oct-11 21:34
nadine123456-Oct-11 21:34 
GeneralRe: Resizing a WPF Window that is a child to a CView Pin
TheGreatAndPowerfulOz7-Oct-11 4:47
TheGreatAndPowerfulOz7-Oct-11 4:47 
GeneralRe: Resizing a WPF Window that is a child to a CView Pin
nadine123458-Oct-11 9:09
nadine123458-Oct-11 9:09 
AnswerRe: Resizing a WPF Window that is a child to a CView Pin
TheGreatAndPowerfulOz18-Oct-11 7:33
TheGreatAndPowerfulOz18-Oct-11 7:33 
QuestionHow do you const your references? Pin
User 5838525-Oct-11 18:35
User 5838525-Oct-11 18:35 
AnswerRe: How do you const your references? Pin
Stefan_Lang6-Oct-11 0:53
Stefan_Lang6-Oct-11 0:53 
GeneralRe: How do you const your references? Pin
TheGreatAndPowerfulOz6-Oct-11 5:55
TheGreatAndPowerfulOz6-Oct-11 5:55 
GeneralRe: How do you const your references? Pin
Stefan_Lang6-Oct-11 6:09
Stefan_Lang6-Oct-11 6:09 
GeneralRe: How do you const your references? Pin
TheGreatAndPowerfulOz6-Oct-11 6:37
TheGreatAndPowerfulOz6-Oct-11 6:37 
GeneralRe: How do you const your references? Pin
Stefan_Lang6-Oct-11 6:48
Stefan_Lang6-Oct-11 6:48 
GeneralRe: How do you const your references? Pin
TheGreatAndPowerfulOz6-Oct-11 7:07
TheGreatAndPowerfulOz6-Oct-11 7:07 
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 

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.