Click here to Skip to main content
15,902,189 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionConversion from Visual studio 6 to VC 2005 Pin
nahitan28-Apr-06 10:01
nahitan28-Apr-06 10:01 
AnswerRe: Conversion from Visual studio 6 to VC 2005 Pin
Nish Nishant28-Apr-06 10:19
sitebuilderNish Nishant28-Apr-06 10:19 
GeneralRe: Conversion from Visual studio 6 to VC 2005 Pin
nahitan1-May-06 3:22
nahitan1-May-06 3:22 
AnswerRe: Conversion from Visual studio 6 to VC 2005 Pin
Hamid_RT28-Apr-06 18:37
Hamid_RT28-Apr-06 18:37 
GeneralRe: Conversion from Visual studio 6 to VC 2005 Pin
nahitan1-May-06 3:22
nahitan1-May-06 3:22 
GeneralRe: Conversion from Visual studio 6 to VC 2005 Pin
Hamid_RT1-May-06 4:02
Hamid_RT1-May-06 4:02 
QuestionSending an Array Pin
dSolariuM28-Apr-06 9:38
dSolariuM28-Apr-06 9:38 
AnswerRe: Sending an Array Pin
valikac28-Apr-06 14:48
valikac28-Apr-06 14:48 
AnswerRe: Sending an Array Pin
ThatsAlok28-Apr-06 23:35
ThatsAlok28-Apr-06 23:35 
QuestionMultiple Top-Level Documents Pin
Andre xxxxxxx28-Apr-06 9:19
Andre xxxxxxx28-Apr-06 9:19 
QuestionZ order of window Pin
pince28-Apr-06 8:26
pince28-Apr-06 8:26 
AnswerRe: Z order of window Pin
Steve Echols28-Apr-06 12:16
Steve Echols28-Apr-06 12:16 
QuestionGet primary thread handle from process handle Pin
Federico Milano28-Apr-06 8:21
Federico Milano28-Apr-06 8:21 
AnswerRe: Get primary thread handle from process handle Pin
Hamid_RT28-Apr-06 18:47
Hamid_RT28-Apr-06 18:47 
Questionerror when loading filter in graphedit Pin
yongwpi28-Apr-06 7:29
yongwpi28-Apr-06 7:29 
AnswerRe: error when loading filter in graphedit Pin
Justin Tay28-Apr-06 13:43
Justin Tay28-Apr-06 13:43 
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 

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.