Click here to Skip to main content
15,899,937 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generala newbie-ish question about windows programming Pin
Jon (is confused)27-Jul-00 20:23
sussJon (is confused)27-Jul-00 20:23 
GeneralRe: a newbie-ish question about windows programming Pin
HP27-Jul-00 20:39
HP27-Jul-00 20:39 
GeneralRe: a newbie-ish question about windows programming Pin
Jon28-Jul-00 5:12
Jon28-Jul-00 5:12 
Generalmissing NAFXCWD.LIB Pin
Patrik Fredriksson27-Jul-00 19:53
Patrik Fredriksson27-Jul-00 19:53 
GeneralRe: missing NAFXCWD.LIB Pin
Mike Dunn27-Jul-00 20:03
Mike Dunn27-Jul-00 20:03 
GeneralCListCtrl not showing all loaded items? Pin
trey27-Jul-00 8:08
trey27-Jul-00 8:08 
GeneralRe: CListCtrl not showing all loaded items? Pin
Paolo Messina28-Jul-00 10:24
professionalPaolo Messina28-Jul-00 10:24 
GeneralRe: CListCtrl not showing all loaded items? Pin
trey29-Jul-00 11:57
trey29-Jul-00 11:57 
Ok, I have a database objectthat has two vectors of CStrings. I update the database and then call LoadListData(). Like I said before this is weird!

Here is the code to initialize the data:

void CMyDlg::LoadListData(CDatabase* database)
{
// Delete the current contents
m_cListCtrl.DeleteAllItems();

// Use the LV_ITEM structure to insert the items
LVITEM lvi;
lvi.mask = LVIF_TEXT;
CString strItem;

int numberOfAddresses = database->GetAddressCount();
for (int i = 0; i < numberOfAddresses; i++)
{
//*
CAddress* a = database->GetAddress(i);

// Filter if necessary
if(m_bFilterOn && a->m_csCategory != m_csFilterCategory)
continue;

// Insert the first item - First Name
lvi.iItem = i;
lvi.iSubItem = 0;
lvi.pszText = (LPTSTR)(LPCTSTR)(a->m_csFName);
m_cListCtrl.InsertItem(&lvi);

// Set subitem 1 - Last Name
lvi.iSubItem = 1;
lvi.pszText = (LPTSTR)(LPCTSTR)(a->m_csLName);
m_cListCtrl.SetItem(&lvi);

// Set subitem 2 - Company
lvi.iSubItem = 2;
lvi.pszText = (LPTSTR)(LPCTSTR)(a->m_csCompany);
m_cListCtrl.SetItem(&lvi);

// Set subitem 3 - Address 1
lvi.iSubItem = 3;
lvi.pszText = (LPTSTR)(LPCTSTR)(a->m_csAddress1);
m_cListCtrl.SetItem(&lvi);

// Set subitem 4 - Address 2
lvi.iSubItem = 4;
lvi.pszText = (LPTSTR)(LPCTSTR)(a->m_csAddress2);
m_cListCtrl.SetItem(&lvi);

// Set subitem 5 - City
lvi.iSubItem = 5;
lvi.pszText = (LPTSTR)(LPCTSTR)(a->m_csCity);
m_cListCtrl.SetItem(&lvi);

// Set subitem 6 - State
lvi.iSubItem = 6;
lvi.pszText = (LPTSTR)(LPCTSTR)(a->m_csState);
m_cListCtrl.SetItem(&lvi);

// Set subitem 7 - Zipcode
lvi.iSubItem = 7;
lvi.pszText = (LPTSTR)(LPCTSTR)(a->m_csZipcode);
}

}
GeneralRe: CListCtrl not showing all loaded items? Pin
Paolo Messina29-Jul-00 12:20
professionalPaolo Messina29-Jul-00 12:20 
GeneralRe: CListCtrl not showing all loaded items? Pin
trey31-Jul-00 17:52
trey31-Jul-00 17:52 
GeneralEdit Control in Explorer Bands Pin
Sivakumar27-Jul-00 7:09
Sivakumar27-Jul-00 7:09 
GeneralEdit Control in Explorer Bands Pin
Sivakumar27-Jul-00 7:08
Sivakumar27-Jul-00 7:08 
GeneralRe: Edit Control in Explorer Bands Pin
Sandu Turcan1-Aug-00 10:37
Sandu Turcan1-Aug-00 10:37 
GeneralGOD HELP ME! Database programming with VC++6 Pin
Steve Lai27-Jul-00 6:34
Steve Lai27-Jul-00 6:34 
GeneralRe: GOD HELP ME! Database programming with VC++6 Pin
Tim Deveaux28-Jul-00 4:51
Tim Deveaux28-Jul-00 4:51 
GeneralRe: How about using SQL directly Pin
Masaaki Onishi28-Jul-00 5:11
Masaaki Onishi28-Jul-00 5:11 
GeneralTHANK YOU TIM & MASAAKI FOR THE RESPONSE! Pin
Steve Lai30-Jul-00 12:16
Steve Lai30-Jul-00 12:16 
GeneralWInword Text Box Pin
Ng Jin Sin27-Jul-00 0:58
Ng Jin Sin27-Jul-00 0:58 
GeneralRe: WInword Text Box Pin
Member 120896527-Jul-00 6:03
Member 120896527-Jul-00 6:03 
GeneralEmbedding metafiles in RTF in Wordpad Pin
ed welch26-Jul-00 23:49
ed welch26-Jul-00 23:49 
GeneralRe: Embedding metafiles in RTF in Wordpad Pin
ed welch8-Aug-00 5:44
ed welch8-Aug-00 5:44 
GeneralStopping a dialog from closing when ESC is pressed Pin
xtsea26-Jul-00 20:35
xtsea26-Jul-00 20:35 
GeneralRe: Stopping a dialog from closing when ESC is pressed Pin
starzykp26-Jul-00 22:39
starzykp26-Jul-00 22:39 
GeneralRe: Stopping a dialog from closing when ESC is pressed Pin
Blake Miller27-Jul-00 5:27
Blake Miller27-Jul-00 5:27 
GeneralAccessing UPDATE_COMMAND_UI in dialog based application Pin
trey26-Jul-00 16:13
trey26-Jul-00 16:13 

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.