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

C / C++ / MFC

 
QuestionEmpty Doc Pin
vivekphlp5-Jun-07 20:27
vivekphlp5-Jun-07 20:27 
AnswerRe: Empty Doc Pin
Hans Dietrich5-Jun-07 20:52
mentorHans Dietrich5-Jun-07 20:52 
GeneralRe: Empty Doc Pin
vivekphlp5-Jun-07 21:17
vivekphlp5-Jun-07 21:17 
AnswerRe: Empty Doc Pin
Rajkumar R6-Jun-07 0:25
Rajkumar R6-Jun-07 0:25 
GeneralRe: Empty Doc Pin
vivekphlp6-Jun-07 20:02
vivekphlp6-Jun-07 20:02 
AnswerRe: Empty Doc Pin
Rajkumar R6-Jun-07 20:55
Rajkumar R6-Jun-07 20:55 
GeneralRe: Empty Doc (SOlved) Pin
vivekphlp8-Jun-07 0:20
vivekphlp8-Jun-07 0:20 
QuestionAdding checkboxes to a list view, checkbox image missing Pin
ljr245-Jun-07 20:23
ljr245-Jun-07 20:23 
I Created a list view and modified the style with LVS_EX_CHECKBOXES, and the checkbox is created, but there is no image where the checkbox should be, only a blank space.

Here's part of the code:


<br />
<br />
CAPPRESULT CListViewCtrl::Create(HWND pHWndParentS_, int nWndID_, CWnd::SCWndConf* pConfDataS)<br />
{<br />
<br />
	CAPPRESULT sRes;<br />
<br />
	if(CAPP_FAILED(sRes = CCtrl::Create(pHWndParentS_, nWndID_, pConfDataS)))<br />
	{<br />
	<br />
		return sRes;<br />
<br />
	}// end if<br />
<br />
	WNDCLASSEX  WindowClassS;<br />
<br />
	if(CWndMgr::GetInstance().InsertRegisteredClassName("CListViewCtrl", FALSE))<br />
	{<br />
<br />
		INITCOMMONCONTROLSEX InitCommCtrlS = {0};<br />
		InitCommCtrlS.dwSize = sizeof(INITCOMMONCONTROLSEX);<br />
		InitCommCtrlS.dwICC = ICC_TREEVIEW_CLASSES;<br />
		//we need to initialize common controls<br />
		InitCommonControlsEx(&InitCommCtrlS);<br />
		<br />
	}// end if<br />
<br />
	DWORD ulStyle, ulExStyle;<br />
	<br />
	if(static_cast<CListViewCtrl::SCListViewCtrlConf*>(pConfDataS)->m_bEditLabel)<br />
	{<br />
	<br />
		ulStyle = WS_TABSTOP | WS_CHILD | WS_VISIBLE | LVS_AUTOARRANGE | LVS_REPORT | LVS_OWNERDATA | LVS_EDITLABELS;<br />
<br />
	}else<br />
	{<br />
<br />
		ulStyle = WS_TABSTOP | WS_CHILD | WS_VISIBLE | LVS_AUTOARRANGE | LVS_REPORT | LVS_OWNERDATA;<br />
	<br />
	}// end else<br />
<br />
	HWND pHWndS;<br />
<br />
	if(static_cast<CListViewCtrl::SCListViewCtrlConf*>(pConfDataS)->m_bNoBorder)<br />
	{<br />
	<br />
		ulExStyle = NULL;<br />
<br />
	}else<br />
	{<br />
<br />
		ulExStyle = WS_EX_CLIENTEDGE;<br />
	<br />
	}// end else<br />
<br />
	if(CAPP_FAILED(sRes = this->CreateEx(ulExStyle, WC_LISTVIEW, "", ulStyle,<br />
									    0,0,0,0, pHWndParentS_, (HMENU) (int) nWndID_, NULL, &pHWndS)))<br />
	{<br />
						<br />
		return sRes;<br />
			<br />
	}// end if<br />
<br />
<br />
	this->m_unIconID = static_cast<CListViewCtrl::SCListViewCtrlConf*>(pConfDataS)->m_unIconID;<br />
<br />
	// we call OnCreate from here since we can't intercept WM_CREATE for system control classes<br />
	if(CAPP_FAILED(sRes = (this->OnCreate(pHWndS, nWndID_))))<br />
	{<br />
			<br />
		return sRes;<br />
<br />
	}// end if<br />
<br />
	return CAPP_ERR_NO_ERRORS;<br />
	<br />
}// end virtual CAPPRESULT CListViewCtrl::Create(HWND pHWndParentS_, int nWndID_, CWnd::SCWndConf* pConfDataS)<br />
<br />
<br />
<br />
<br />
CAPPRESULT CListViewCtrl::SetExtendedStyleEx(DWORD ulExMask_, DWORD ulExStyle_)<br />
{<br />
<br />
	CAPPRESULT sRes;<br />
<br />
	HWND pHWndS;<br />
<br />
	if(CAPP_FAILED(sRes = this->GetHWnd(&pHWndS)))<br />
	{<br />
	<br />
		return sRes;<br />
<br />
	}// end if<br />
<br />
	ListView_SetExtendedListViewStyleEx(pHWndS, ulExMask_, ulExStyle_);<br />
<br />
<br />
	return CAPP_ERR_NO_ERRORS;<br />
	<br />
}// end CAPPRESULT CListViewCtrl::SetExtendedStyleEx(DWORD ulExMask_, DWORD ulExStyle_)<br />
<br />
<br />
<br />
CAPPRESULT CListViewCtrl::OnCreate(HWND pHWndS_, int nWndID_)<br />
{<br />
	<br />
	CAPPRESULT sRes;<br />
	if(CAPP_FAILED(sRes = CCtrl::OnCreate(pHWndS_, nWndID_)))<br />
	{<br />
	<br />
		return sRes;<br />
<br />
	}// end if<br />
<br />
	if(this->m_unIconID)<br />
	{<br />
<br />
		// create the image list to contain bitmaps for the buttons<br />
		if(CAPP_FAILED(sRes = this->m_ImageListC.Create( 16, 16, ILC_COLOR32 | ILC_MASK, 1, 0 )))<br />
		{<br />
		<br />
			return sRes;<br />
<br />
		}// end if<br />
<br />
		HICON pIconHandleS;<br />
<br />
		if(!(pIconHandleS = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(this->m_unIconID), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR)))<br />
		{<br />
<br />
			return sRes;<br />
<br />
		}// end if<br />
<br />
		UINT unImageIndex;<br />
		// create the image list to contain bitmaps for the buttons<br />
		if(CAPP_FAILED(sRes = this->m_ImageListC.Add((HICON)pIconHandleS, &unImageIndex)))<br />
		{<br />
		<br />
			return sRes;<br />
<br />
		}// end if<br />
<br />
		if(CAPP_FAILED(sRes = this->SetImageList(&this->m_ImageListC, CListViewCtrl::m_eImageListStyle::SMALL)))<br />
		{<br />
		<br />
			return sRes;<br />
<br />
		}// end if<br />
<br />
	}// end if<br />
<br />
<br />
<br />
	return CAPP_ERR_NO_ERRORS;<br />
<br />
}// end CAPPRESULT CListViewCtrl::OnCreate(HWND pHWndS_, int nWndID_)<br />
<br />
<br />
<br />
<br />
// Here's the code that creates the window<br />
<br />
<br />
	CListViewCtrl::SCListViewCtrlConf ConfDataS;<br />
<br />
	ZeroMemory(&ConfDataS, sizeof(CChildWnd::SCChildWndConf));<br />
	<br />
	ConfDataS.m_bFrameDrawOvr = FALSE;<br />
	ConfDataS.m_bClientDrawOvr = FALSE;<br />
	ConfDataS.m_bEditLabel = FALSE;<br />
	ConfDataS.m_pParentC = this;<br />
	ConfDataS.m_unIconID = NULL;<br />
	ConfDataS.m_fRelX = 0;<br />
	ConfDataS.m_fRelY = 13;<br />
	ConfDataS.m_fRelWidth = 100;<br />
	ConfDataS.m_fRelHeight = 87;<br />
	ConfDataS.m_nNoReszSide = CChildWnd::SCChildWndConf::m_eNoReszSide::NO_RESZ_TOP | CChildWnd::SCChildWndConf::m_eNoReszSide::NO_RESZ_LEFT | CChildWnd::SCChildWndConf::m_eNoReszSide::NO_RESZ_RIGHT | CChildWnd::SCChildWndConf::m_eNoReszSide::NO_RESZ_BOTTOM;<br />
<br />
	if(CAPP_FAILED(sRes = this->AddChild("CListViewCtrl", &(this->m_pClientEventsListViewC), &ConfDataS, &(this->m_nClientEventsListViewID))))<br />
	{<br />
	<br />
		return sRes;<br />
<br />
	}// end if<br />
<br />
/// And here's the one that adds the columns and the checkboxes<br />
<br />
<br />
	LV_COLUMN   ListViewColumnS;<br />
<br />
	//initialize the columns<br />
	ListViewColumnS.mask    = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;<br />
	ListViewColumnS.fmt     = LVCFMT_LEFT;<br />
	ListViewColumnS.cx      = 100;<br />
	ListViewColumnS.pszText = "Evento";<br />
<br />
    int nColumnIndex = 0;<br />
	// initialize the list view<br />
	if(CAPP_FAILED(sRes = dynamic_cast<CListViewCtrl*>(this->m_pClientEventsListViewC)->InsertColumn(nColumnIndex, &ListViewColumnS, &nColumnIndex)))<br />
	{<br />
	<br />
		return sRes;<br />
<br />
	}// end if<br />
<br />
<br />
	//initialize the columns<br />
	ListViewColumnS.mask    = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;<br />
	ListViewColumnS.fmt     = LVCFMT_LEFT;<br />
	ListViewColumnS.cx      = 100;<br />
	ListViewColumnS.pszText = "Utilidades";<br />
<br />
    nColumnIndex = 1;<br />
	// initialize the list view<br />
	if(CAPP_FAILED(sRes = dynamic_cast<CListViewCtrl*>(this->m_pClientEventsListViewC)->InsertColumn(nColumnIndex, &ListViewColumnS, &nColumnIndex)))<br />
	{<br />
	<br />
		return sRes;<br />
<br />
	}// end if<br />
<br />
	// set the checkboxes<br />
	if(CAPP_FAILED(sRes = dynamic_cast<CListViewCtrl*>(this->m_pClientEventsListViewC)->SetExtendedStyleEx(LVS_EX_CHECKBOXES, LVS_EX_CHECKBOXES)))<br />
	{<br />
	<br />
		return sRes;<br />
<br />
	}// end if<br />
<br />
<br />
<br />
<br />



Please if anybody has any clue as to what might be happening let me know.
I aoplogize if the OO library that I'm using, which is my own, can be a bit confusing, but it's basically the same Win32.
AnswerRe: Adding checkboxes to a list view, checkbox image missing Pin
Hamid_RT5-Jun-07 21:32
Hamid_RT5-Jun-07 21:32 
QuestionCEditView Print Setup Pin
TariqZ5-Jun-07 19:42
TariqZ5-Jun-07 19:42 
Questionmenu help Pin
p_5-Jun-07 18:52
p_5-Jun-07 18:52 
QuestionRe: menu help Pin
Hamid_RT5-Jun-07 19:09
Hamid_RT5-Jun-07 19:09 
QuestionCHtmlView with dialog templates? Pin
HappyFunBall5-Jun-07 18:19
HappyFunBall5-Jun-07 18:19 
AnswerRe: CHtmlView with dialog templates? Pin
Rajkumar R5-Jun-07 18:31
Rajkumar R5-Jun-07 18:31 
GeneralRe: CHtmlView with dialog templates? Pin
HappyFunBall5-Jun-07 19:05
HappyFunBall5-Jun-07 19:05 
GeneralRe: CHtmlView with dialog templates? Pin
Rajkumar R5-Jun-07 19:30
Rajkumar R5-Jun-07 19:30 
GeneralRe: CHtmlView with dialog templates? Pin
HappyFunBall5-Jun-07 20:16
HappyFunBall5-Jun-07 20:16 
AnswerRe: CHtmlView with dialog templates? Pin
Rajkumar R5-Jun-07 20:39
Rajkumar R5-Jun-07 20:39 
GeneralRe: CHtmlView with dialog templates? Pin
HappyFunBall5-Jun-07 21:21
HappyFunBall5-Jun-07 21:21 
AnswerRe: CHtmlView with dialog templates? Pin
Rajkumar R5-Jun-07 22:47
Rajkumar R5-Jun-07 22:47 
GeneralRe: CHtmlView with dialog templates? Pin
Hamid_RT5-Jun-07 19:51
Hamid_RT5-Jun-07 19:51 
Questionmail from vc++ program Pin
prathuraj5-Jun-07 18:04
prathuraj5-Jun-07 18:04 
AnswerRe: mail from vc++ program Pin
Hamid_RT5-Jun-07 18:58
Hamid_RT5-Jun-07 18:58 
GeneralRe: mail from vc++ program Pin
prathuraj5-Jun-07 20:58
prathuraj5-Jun-07 20:58 
GeneralRe: mail from vc++ program Pin
Hamid_RT5-Jun-07 21:25
Hamid_RT5-Jun-07 21:25 

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.