User 10924543
Posts
-
What MFC class applies to the listbox control in VS2010 resource editor? -
Can some one please tell me how to insert items into a friggin CListCtrlI have been reading the documentation - where else do you think I obtained those methods that I have been trying. This is what I have tried precisely. And function
int InsertItem(
int nItem,
LPCTSTR lpszItem,as described here (http://msdn.microsoft.com/en-us/library/8b9s12fc.aspx[^]), DOES NOT WORK The function does nothing. WHY? Can you only add items to a CListCtrl via
int InsertItem(
const LVITEM* pItem
);and the function that I have been using is in fact defunct?
**void CImageDialog::DDX_List(CDataExchange* pDX, UINT uListCtrlID, CStringArray& rarrayOtherImgFiles)
{
CListCtrl* pListCtrl = (CListCtrl*)GetDlgItem(uListCtrlID);
int nI = 0;
CString strItem;ASSERT\_VALID(pListCtrl); if (pDX->m\_bSaveAndValidate) { m\_arrayOtherImageFiles.RemoveAll(); for (nI = 0; nI < pListCtrl->GetItemCount(); nI++) { strItem = pListCtrl->GetItemText(nI, 0); m\_arrayOtherImageFiles.Add(strItem); } } else { pListCtrl->DeleteAllItems(); for (nI = m\_arrayOtherImageFiles.GetCount() - 1; nI >= 0; nI--) { pListCtrl->InsertItem(1, m\_arrayOtherImageFiles.GetAt(nI)); } }
}**
void CImageDialog::DoDataExchange(CDataExchange* pDX)
{
CMyDialog::DoDataExchange(pDX);
DDX_Text(pDX, IDC_EDIT_HEADER_IMG, m_strHeaderImageFile);
DDX_Text(pDX, IDC_EDIT_NAV_IMG1, m_strNavImg1File);
DDX_Text(pDX, IDC_EDIT_NAV_IMG2, m_strNavImg2File);
DDX_Text(pDX, IDC_EDIT_OTHER_IMG_FILES, m_strOtherImgFiles);
DDX_List(pDX, IDC_LIST_OTHER_IMG_FILES, m_arrayOtherImageFiles);
} -
Can some one please tell me how to insert items into a friggin CListCtrlThis method does not work:
// Insert item for col 0
lvi.mask = LVIF_TEXT;
lvi.pszText = "one";
m_ListCtrl.InsertItem(&lvi);
// Insert subitem for col 1
lvi.pszText = "two";
lvi.iSubItem = 1;
m_ListCtrl.InsertItem(&lvi);This method does not work:
for (int nI = 0; nI < m\_strarrayOtherImgFiles.GetCount(); nI++) { pOtherImgsList->SetItemText(nI, 0, m\_strarrayOtherImgFiles.GetAt(nI)); }
Nothing seems to work.
-
Visual studio 2010 - class wizardWith visual studio 6 you were able to delete the .clw file to re-build the class wizard if you made a lot of changes in the source files and that were not showing in the class wizard. How do you do this with VS 2010 - there is no longer a .clw file.
-
How do you do data exchange (as in DDX_ functions/macros)....If you have a CMFCShellListCtrl..........CListCtrl with multiple selections?
-
Using CMFCShellListCtrlAccident.
-
Using CMFCShellListCtrlI know the functions you use to get the current working directory in the control, but how do you get a list of selected files from it? I can't find any examples of this.
-
Visual studio 2010 compile error - I don't understand how to fix itIt turned out that I was looking in the wrong file. The problem as the App definition file not the dialog definition file.
-
Visual studio 2010 compile error - I don't understand how to fix itIt turned out that I was looking in the wrong file. The problem as the App definition file not the dialog defionition file.
-
Using CMFCShellListCtrlI have found the functions that you use to obtain the current working directory in the control, but how do you get a list of selected files (or other objects) from it. I have not been able to find an example any where thus far. Can you point me in the direction of such a code example?
-
Visual studio 2010 compile error - I don't understand how to fix itError 1 error C2504: 'CMyDialog' : base class undefined c:\greg\easywebstoreuploader\easywebstoreuploaderdlg.h 9
In the source file I have included the MyDialog.h above the header file containing the class definition for CEasyWebStoreUploaderDlg but I can't pi$$ this compiler error off and I don't understand why. Can any one help me?
#include "stdafx.h";
#include "INI.h"
#include #include #include "MyDialog.h"
//#include "ServerDialog.h"
//#include "ImageDialog.h"
#include "EasyWebStoreUploaderDlg.h"
#include "EasyWebStoreUploader.h"Header file
/ EasyWebStoreUploaderDlg.h : header file
//#pragma once
// CEasyWebStoreUploaderDlg dialog
class CEasyWebStoreUploaderDlg : public CMyDialog
{
// Construction
public:
CEasyWebStoreUploaderDlg(CWnd* pParent = NULL); // standard constructor
~CEasyWebStoreUploaderDlg();// Dialog Data enum { IDD = IDD\_EASYWEBSTOREUPLOADER\_DIALOG }; protected: virtual void DoDataExchange(CDataExchange\* pDX); // DDX/DDV support // Implementation protected: HICON m\_hIcon; //CServerDialog m\_dialogServer; // Generated message map functions virtual BOOL OnInitDialog(); afx\_msg void OnSysCommand(UINT nID, LPARAM lParam); afx\_msg void OnPaint(); afx\_msg HCURSOR OnQueryDragIcon(); DECLARE\_MESSAGE\_MAP() public: afx\_msg void OnClickConnect(); afx\_msg void OnClickUploadAll(); afx\_msg void OnChangeTab(NMHDR \*pNMHDR, LRESULT \*pResult); CTabCtrl m\_tabCtrl;
};
Source file
// EasyWebStoreUploaderDlg.cpp : implementation file
//#include "stdafx.h"
#include "INI.h"
#include
#include "afxcmn.h"
#include "MyDialog.h"
//#include "ServerDialog.h"
//#include "ImageDialog.h"
#include "EasyWebStoreUploaderDlg.h"
#include "EasyWebStoreUploader.h"#ifdef _DEBUG
#define new DEBUG_NEW
#endif// CAboutDlg dialog used for App About
class CAboutDlg : public CDialogEx
{
public:
CAboutDlg();// Dialog Data enum { IDD = IDD\_ABOUTBOX }; protected: virtual void DoDataExchange(CDataExchange\* pDX); // DDX/DDV support // Implementation protected: DECLARE\_MESSAGE\_MAP()
};
CAboutDlg::CAboutDlg() : CDialogEx(CAboutDlg::IDD)
{
}void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
}BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx)
END_MESSAGE_MAP()// CEasyWebStoreUploaderDlg dialog
CEasyWebStoreUploaderDlg: