Click here to Skip to main content
14,421,696 members

C / C++ / MFC

 
AnswerRe: List HDD files in CListView Pin
Richard MacCutchan11-Dec-18 7:00
communityengineerRichard MacCutchan11-Dec-18 7:00 
GeneralRe: List HDD files in CListView Pin
_Flaviu11-Dec-18 8:52
Member_Flaviu11-Dec-18 8:52 
GeneralRe: List HDD files in CListView Pin
Richard MacCutchan11-Dec-18 23:01
communityengineerRichard MacCutchan11-Dec-18 23:01 
SuggestionRe: List HDD files in CListView Pin
David Crow11-Dec-18 14:27
MemberDavid Crow11-Dec-18 14:27 
GeneralRe: List HDD files in CListView Pin
_Flaviu11-Dec-18 23:36
Member_Flaviu11-Dec-18 23:36 
SuggestionRe: List HDD files in CListView Pin
David Crow12-Dec-18 3:53
MemberDavid Crow12-Dec-18 3:53 
GeneralRe: List HDD files in CListView Pin
_Flaviu13-Dec-18 0:15
Member_Flaviu13-Dec-18 0:15 
QuestionDriving Ctatic::DrawItem Pin
ForNow10-Dec-18 16:16
MemberForNow10-Dec-18 16:16 
I have an owerdraw ComboBox When a user selects an Item I want to Display the Detail info

I figure I could use the same Dialog for Background

So for the 6 CStatic and Their 6 Labels I do ShowWindow(SW_HIDE)

I saw the following post on how to drive DrawItem by Calling invalidate an the SetWindowText

Getting owner draw child control to paint when calling SetWindowText - vc.mfc[^]

So I create my own derived CStatic

class MyStatic : public CStatic
{ DECLARE_DYNAMIC(MyStatic)
public:
	MyStatic();
	~MyStatic();
	
	void SetWindowText(LPSTR);
	void DrawItem(LPDRAWITEMSTRUCT pdis);

};


This my SSetWindowText
void MyStatic::SetWindowText(LPSTR lpsz)
{
	Invalidate();
	CStatic::SetWindowText(lpsz);

}


two bad things on the way to getting where I want

1) I get an exception in wincore.cpp at the retrun ::CallWindowProc
RESULT CWnd::DefWindowProc(UINT nMsg, WPARAM wParam, LPARAM lParam)
{
	if (m_pfnSuper != NULL)
		return ::CallWindowProc(m_pfnSuper, m_hWnd, nMsg, wParam, lParam);

	WNDPROC pfnWndProc;
	if ((pfnWndProc = *GetSuperWndProcAddr()) == NULL)
		return ::DefWindowProc(m_hWnd, nMsg, wParam, lParam);
	else

2) After the exception my Drawitem is called however ItemData doesn't have the String pointer and and is NULL

Thanks
AnswerRe: Driving Ctatic::DrawItem Pin
ForNow11-Dec-18 16:58
MemberForNow11-Dec-18 16:58 
Question有什么学习途径 Pin
Member 140765679-Dec-18 21:30
MemberMember 140765679-Dec-18 21:30 
SuggestionRe: What is the learning path? Pin
Richard Deeming11-Dec-18 2:09
communityengineerRichard Deeming11-Dec-18 2:09 
QuestionAfxMessage doesn’t block Pin
ForNow6-Dec-18 3:02
MemberForNow6-Dec-18 3:02 
AnswerRe: AfxMessage doesn’t block Pin
Victor Nijegorodov6-Dec-18 6:22
MemberVictor Nijegorodov6-Dec-18 6:22 
GeneralRe: AfxMessage doesn’t block Pin
ForNow6-Dec-18 6:26
MemberForNow6-Dec-18 6:26 
GeneralRe: AfxMessage doesn’t block Pin
Victor Nijegorodov6-Dec-18 9:45
MemberVictor Nijegorodov6-Dec-18 9:45 
GeneralRe: AfxMessage doesn’t block Pin
ForNow6-Dec-18 9:49
MemberForNow6-Dec-18 9:49 
QuestionKeyboard functionality for IExplorerBrowser Pin
_Flaviu5-Dec-18 21:59
Member_Flaviu5-Dec-18 21:59 
QuestionFound Api's Causing Heap Corruption Pin
ForNow5-Dec-18 3:23
MemberForNow5-Dec-18 3:23 
AnswerRe: Found Api's Causing Heap Corruption Pin
CPallini5-Dec-18 4:08
mveCPallini5-Dec-18 4:08 
GeneralRe: Found Api's Causing Heap Corruption Pin
ForNow5-Dec-18 4:11
MemberForNow5-Dec-18 4:11 
GeneralRe: Found Api's Causing Heap Corruption CPallini You are Great thanks Pin
ForNow5-Dec-18 4:40
MemberForNow5-Dec-18 4:40 
GeneralRe: Found Api's Causing Heap Corruption CPallini You are Great thanks Pin
CPallini5-Dec-18 7:50
mveCPallini5-Dec-18 7:50 
GeneralRe: Found Api's Causing Heap Corruption CPallini You are Great thanks Pin
ForNow5-Dec-18 8:28
MemberForNow5-Dec-18 8:28 
GeneralRe: Found Api's Causing Heap Corruption Pin
Richard MacCutchan5-Dec-18 8:43
communityengineerRichard MacCutchan5-Dec-18 8:43 
GeneralRe: Found Api's Causing Heap Corruption Pin
CPallini5-Dec-18 8:49
mveCPallini5-Dec-18 8:49 

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.