Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Error winctrl5.cpp Collapse All
Subject Author Date
LEANDRO GUZMAN Jul 28, 2006 - 9:43 AM

I there, I have the following problem:
I’ve developed a dialog aplication that uses CExtDateTimeWnd and CExtDurationWnd controls in the main dialog.
The aplication works just fine in debug and release modes.
Now the problem. yesterday, I was changing my pc for another one, and when i try to execute the code in the new pc (in debug mode!) I receive the next error message:

Debug assertion Failed!
File: winctrl5.cpp line: 189

(obviously I perform a clean/rebuild all)

I’ve tracked down the problem and it happens in the main dialog’s construction, in the moment when the control member variable CExtDurationWnd m_wnd_xx; is created, in the line:
(ExtDurationWnd.cpp) m_dtDate = COleDateTime::GetCurrentTime();

My OS data
windows Xp SP2
visual c++ 6.0 sp6
settings: EspaA±ol internacional - Chile

thanks in advanced.

LEANDRO GUZMAN Jul 28, 2006 - 2:49 PM

Hi there, the call stack is the next one:

CDateTimeCtrl::GetTime(COleDateTime & {...}) line 189 + 31 bytes
CExtDateTimeWnd::CExtDateTimeWnd() line 2632 + 9 bytes
CSA2OP_CTDlg::CSA2OP_CTDlg(CWnd * 0x00000000 {CWnd hWnd=???}) line 108 + 1192 bytes
CSA2OP_CTApp::InitInstance() line 146 + 13 bytes
AfxWinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00141f00, int 1) line 39 + 11 bytes
WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00141f00, int 1) line 30
WinMainCRTStartup() line 330 + 54 bytes
KERNEL32! 7c816d4f()

thanks


Technical Support Jul 31, 2006 - 8:54 AM

Here is the constructor of the CExtDateTimeWnd class:

CExtDateTimeWnd::CExtDateTimeWnd()
 : CExtDurationWnd()
 , m_bBlankYear( false )
 , m_bBlankMonth( false )
 , m_bBlankDay( false )
 , m_bBlankHour( false )
 , m_bBlankMinute( false )
 , m_bBlankSecond( false )
 , m_bBlankDesignator( false )
 , m_bAutoSelectNext( false )
{
 m_eMode = CExtDateTimeWnd::all;
 m_eTimeFormat = CExtDateTimeWnd::automatic;
 
 m_dtDate = COleDateTime::GetCurrentTime();
 
 SetStatus( CExtDurationWnd::null );
}
As you can see it does not use CDateTimeCtrl at all, so the problem has nothing to do with CExtDateTimeWnd. We can guess that you may incorrectly create the CExtDateTimeWnd control. In the dialog resource editor you put the Date Time Picker standard control on the form. But actually the CExtDateTimeWnd control is not based on the CDateTimeCtrl control, it is a control coded from the scratch, so the Custom Control type should be used instead. Please take a look at the IDD_PAGE_DATE_TIME_DURATION form in the ProfUIS_Controls sample. There you can see the IDC_DATETIME custom control which is used for creating the CExtDateTimeWnd control.

Technical Support Jul 28, 2006 - 10:48 AM

Line 189 in WINCTRL5.CPP corresponds to the CDateTimeCtrl::GetTime() method. But actually neither CExtDateTimeWnd nor CExtDurationWnd use CDateTimeCtrl. Would you send us a call stack so we can see the calling sequence?