Click here to Skip to main content
15,888,454 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: error when loading filter in graphedit Pin
yongwpi28-Apr-06 16:05
yongwpi28-Apr-06 16:05 
GeneralRe: error when loading filter in graphedit Pin
Justin Tay28-Apr-06 17:47
Justin Tay28-Apr-06 17:47 
GeneralRe: error when loading filter in graphedit Pin
yongwpi28-Apr-06 18:01
yongwpi28-Apr-06 18:01 
GeneralRe: error when loading filter in graphedit Pin
Justin Tay28-Apr-06 18:17
Justin Tay28-Apr-06 18:17 
GeneralRe: error when loading filter in graphedit Pin
yongwpi29-Apr-06 4:45
yongwpi29-Apr-06 4:45 
GeneralRe: error when loading filter in graphedit Pin
Justin Tay29-Apr-06 5:40
Justin Tay29-Apr-06 5:40 
GeneralRe: error when loading filter in graphedit Pin
yongwpi30-Apr-06 11:12
yongwpi30-Apr-06 11:12 
QuestionQuestion about CAxDialogImpl class in VC++ 6.0 Pin
Barry True28-Apr-06 7:16
Barry True28-Apr-06 7:16 
We've got two classes that we use to resize standard CDialog-based classes and to show a resize handle in the lower right-hand corner of the dialog. These work fine when the class is derived from CDialog. However, if the class is derived from CAxDialogImpl we have problems instantiating the class that shows the resize handle.

The class used to show the resize handle is called CEasyStatusBar and is derived from CStatusBarCtrl. The class has a Create() method which is the first method that classes that use the CEasyStatusBar class must invoke. The Create() takes a CWnd pointer which is normally passed as the this pointer from CDialog based classes. However in the CAxDialogImpl class we are using CWnd::FromHandle(m_hWnd) to get the CWnd pointer to pass in to the Create() method. The Create() method does a few things and then invokes the CStatusBarCtrl::Create() method as follows:

BOOL IsVisible = parent->IsWindowVisible(); // parent is the CWnd pointer
DWORD ProgressBarStyle = WS_CHILD | CCS_BOTTOM | SBARS_SIZEGRIP | SBT_OWNERDRAW;
CStatusBarCtrl::Create(ProgressBarStyle, CRect(0, 0, 0, 0), parent, 1);

When it gets into the CStatusBarCtrl::Create() method an assertion failure is being generated. I debugged into this to find out where and it is performing the following:

The CStatusBarCtrl::Create() method is invoking VERIFY(AfxDeferRegisterClass(AFX_WNDCOMMCTL_BAR_REG)). This is invoking AfxEndDeferRegisterClass() which is doing the following:

// mask off all classes that are already registered
AFX_MODULE_STATE* pModuleState = AfxGetModuleState();
fToRegister &= ~pModuleState->m_fRegisteredClasses;
if (fToRegister == 0)
return TRUE;

LONG fRegisteredClasses = 0;

// common initialization
WNDCLASS wndcls;
memset(&wndcls, 0, sizeof(WNDCLASS)); // start with NULL defaults
Wndcls.lpfnWndProc = DefWindowProc;
Wndcls.hInstance = AfxGetInstanceHandle();

The first thing the AFxGetInstanceHandle() method does is do an ASSERT(afxCurrentInstanceHandle != NULL) which is failing and causing the assertion fault. I debugged into this with one of our other classes based on CDialog and in that one, fToRegister was set to 0 so it was never getting to the AfxGetInstanceHandle() method.

Does anyone have any clues as to what could be causing our CAxDialogImpl-based class to get the above assertion failure?

-- modified at 18:46 Saturday 29th April, 2006
QuestionHandle to Dialog, In Dialog Application Pin
jerry1211a28-Apr-06 6:52
jerry1211a28-Apr-06 6:52 
QuestionRe: Handle to Dialog, In Dialog Application Pin
David Crow28-Apr-06 7:42
David Crow28-Apr-06 7:42 
AnswerRe: Handle to Dialog, In Dialog Application Pin
Hamid_RT28-Apr-06 19:22
Hamid_RT28-Apr-06 19:22 
AnswerRe: Handle to Dialog, In Dialog Application Pin
Steve Echols28-Apr-06 22:42
Steve Echols28-Apr-06 22:42 
Questionhow to convert a CString to unsigned short Pin
joy2128-Apr-06 6:02
joy2128-Apr-06 6:02 
AnswerRe: how to convert a CString to unsigned short Pin
David Crow28-Apr-06 6:23
David Crow28-Apr-06 6:23 
AnswerRe: how to convert a CString to unsigned short Pin
Steve Echols28-Apr-06 12:26
Steve Echols28-Apr-06 12:26 
QuestionWin 3.x apps with VC6-8 Pin
Andre xxxxxxx28-Apr-06 5:40
Andre xxxxxxx28-Apr-06 5:40 
AnswerRe: Win 3.x apps with VC6-8 Pin
Gordon Brandly28-Apr-06 7:09
Gordon Brandly28-Apr-06 7:09 
GeneralRe: Win 3.x apps with VC6-8 Pin
Maximilien28-Apr-06 7:24
Maximilien28-Apr-06 7:24 
GeneralRe: Win 3.x apps with VC6-8 Pin
Gordon Brandly28-Apr-06 8:40
Gordon Brandly28-Apr-06 8:40 
GeneralRe: Win 3.x apps with VC6-8 Pin
Kevin McFarlane28-Apr-06 11:33
Kevin McFarlane28-Apr-06 11:33 
AnswerRe: Win 3.x apps with VC6-8 Pin
Michael Dunn28-Apr-06 9:38
sitebuilderMichael Dunn28-Apr-06 9:38 
QuestionInterface programming in MFC Pin
cmdill28-Apr-06 4:01
cmdill28-Apr-06 4:01 
QuestionHello - problem in tree control in mfc Pin
Raja Bose C Leo28-Apr-06 3:08
Raja Bose C Leo28-Apr-06 3:08 
AnswerRe: Hello - problem in tree control in mfc Pin
David Crow28-Apr-06 3:28
David Crow28-Apr-06 3:28 
Questiondouble core processors support from VC Pin
9ine28-Apr-06 3:01
9ine28-Apr-06 3:01 

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.