remplissagecombo depuis cet exemple:
http://www.cppfrance.com/code.aspx?id=18942int ImportCmbAuteurs()
{
_bstr_t bst;
long l, bok = 0;
try {
prsA->Open(szAUTEURS, _variant_t((IDispatch *) pdb, true),
adOpenForwardOnly, adLockReadOnly, adCmdTable);
}
catch(_com_error &e) {MsgComError(e); return 0;}
try {
while(!prsA->EndOfFile) {
countA++;
bst = prsA->Fields->GetItem((long)1)->Value;
l = prsA->Fields->GetItem((long)0)->Value;
SendMessage(hcmbAut, CB_SETITEMDATA,
SendMessage(hcmbAut, CB_ADDSTRING, 0, (long) (char*) bst), l);
prsA->MoveNext();
}
bok = 1;
}
catch(_com_error &e) {MsgComError(e);}
prsA->Close();
if(!bok) return 0;
if(countA) SendMessage(hcmbAut, CB_SETCURSEL, 0, 0);
return 1;
}
y a tout de même pas de quoi se fouler un neuron, non ?
ciao...
BruNews, MVP VC++