Click here to Skip to main content
15,910,411 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Jochen Arndt8-Feb-12 2:04
professionalJochen Arndt8-Feb-12 2:04 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Fallen1238-Feb-12 2:44
Fallen1238-Feb-12 2:44 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Jochen Arndt8-Feb-12 3:19
professionalJochen Arndt8-Feb-12 3:19 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Fallen1238-Feb-12 4:04
Fallen1238-Feb-12 4:04 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Jochen Arndt8-Feb-12 4:20
professionalJochen Arndt8-Feb-12 4:20 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Fallen1238-Feb-12 4:44
Fallen1238-Feb-12 4:44 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Eugen Podsypalnikov8-Feb-12 4:53
Eugen Podsypalnikov8-Feb-12 4:53 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Fallen1239-Feb-12 10:19
Fallen1239-Feb-12 10:19 
Okay I created this in LBA (basically copied meat from MS

CString LBA::RegisterLbaAsClass(void)
{
WNDCLASS wndcls;
CString hold=_T("ListBoxAdvanced");

memset(&wndcls, 0, sizeof(WNDCLASS));   // start with NULL defaults

wndcls.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;


wndcls.lpfnWndProc = ::DefWindowProc; 
wndcls.hInstance = AfxGetInstanceHandle();
wndcls.hIcon = NULL;
wndcls.hCursor = NULL;
wndcls.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wndcls.lpszMenuName = NULL;
wndcls.lpszClassName = _T("ListBoxAdvanced");

// Register the new class and trace if it fails
if(!AfxRegisterClass(&wndcls))
{
   TRACE("LBA Class Registration Failed\n");
}
	return hold;
}


And This in OnInitialDialog

C++
	CWnd* pcWnd=GetDlgItem(IDC_MovieCtrl);
  if (pcWnd->GetSafeHwnd())
  {
	rec.left=7;rec.right=1607;rec.top=70;rec.bottom=802;
    pcWnd->DestroyWindow();
  }
//register the class
  CString hold=m_movielist.RegisterLbaAsClass();
//and create
  if(!m_movielist.Create(hold,NULL,WS_CHILD|WS_VISIBLE|WS_BORDER,rec,this))
 	{
		MessageBox(_T("Failed"));
		long k=GetLastError();
		k=k;
	}



it throws exception during movielist.Create ...
Unhandled exception at 0x77544621 in MediaPlayer.exe: 0xC015000F: The activation context being deactivated is not the most recently activated one.

Truly confused -Not at all sure what I'm doing
never had to register my derived class before -They were all derived from std controls easy peasy

Figured it out -- turned on win32 exceptions -- error showed right up
Last thing to tangle with -- heap corruption on exit -I Hate these they could be anywhere

Well thanx for your help

modified 10-Feb-12 1:20am.

GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Eugen Podsypalnikov9-Feb-12 20:30
Eugen Podsypalnikov9-Feb-12 20:30 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Fallen12310-Feb-12 5:35
Fallen12310-Feb-12 5:35 
AnswerRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Richard MacCutchan5-Feb-12 23:17
mveRichard MacCutchan5-Feb-12 23:17 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Fallen1235-Feb-12 23:38
Fallen1235-Feb-12 23:38 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Richard MacCutchan6-Feb-12 0:04
mveRichard MacCutchan6-Feb-12 0:04 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Fallen1236-Feb-12 0:35
Fallen1236-Feb-12 0:35 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Richard MacCutchan6-Feb-12 1:14
mveRichard MacCutchan6-Feb-12 1:14 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Fallen1236-Feb-12 2:16
Fallen1236-Feb-12 2:16 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Richard MacCutchan6-Feb-12 3:03
mveRichard MacCutchan6-Feb-12 3:03 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Fallen1236-Feb-12 6:35
Fallen1236-Feb-12 6:35 
QuestionSegFault Pin
chidacode5-Feb-12 7:07
chidacode5-Feb-12 7:07 
AnswerRe: SegFault Pin
Albert Holguin5-Feb-12 8:45
professionalAlbert Holguin5-Feb-12 8:45 
AnswerRe: SegFault Pin
CPallini5-Feb-12 21:57
mveCPallini5-Feb-12 21:57 
GeneralRe: SegFault Pin
Albert Holguin6-Feb-12 10:14
professionalAlbert Holguin6-Feb-12 10:14 
AnswerRe: SegFault Pin
Stephen Hewitt6-Feb-12 4:07
Stephen Hewitt6-Feb-12 4:07 
QuestionTCP/IP problems Pin
ForNow4-Feb-12 16:27
ForNow4-Feb-12 16:27 
AnswerRe: TCP/IP problems Pin
Mohibur Rashid5-Feb-12 4:34
professionalMohibur Rashid5-Feb-12 4:34 

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.