Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Debug Assertion Failed in Microsoft Visual C++ v5.0 Debug Library

276 views
Skip to first unread message

Herbert

unread,
Jan 6, 1998, 3:00:00 AM1/6/98
to

I am using VC Version 5.0 Enterprise version for almost half a month
in this PC. When I run my application generated by VC5.0 It says :

Title: Microsoft Visual C++ Debug Library
Body:DEbug Assertion Failed!
Program C:\MY_PROJ\CASH97\DEBUG\CASH97.EXE
File: dlgdata.cpp
Line: 290

For infomation on how your program can cause an assertion failure, see
the Visual C++ documentation on asserts.
(Press Retry to debug the application)
[Abort] [Retry] [Ignore]

When I press retry Windows95 crushed " this program has performed an
illegal operation and will shutdown" and my application closed and
ended.

When use "Win32 Release" rather than "Win32 Debug" in BUILD/SET ACTIVE
CONFIGATION.
No this problem

my computer is P133 with 16m RAM and 1.2G hard disk(enough free hard
disk) VC is the only task running

Is that some DLL files damaged? or no enough RAM? This program is only
a test of using FTP to GET and PUT files. Very easy one.

Please E-mail me as well

Herbert
her...@ascom.com.sg


Dirk Djuga

unread,
Jan 6, 1998, 3:00:00 AM1/6/98
to

> I am using VC Version 5.0 Enterprise version for almost half a month
> in this PC. When I run my application generated by VC5.0 It says :
>
> Title: Microsoft Visual C++ Debug Library
> Body:DEbug Assertion Failed!
> Program C:\MY_PROJ\CASH97\DEBUG\CASH97.EXE
> File: dlgdata.cpp
> Line: 290
>

Herbert,
It may help if you tell us what is actually being asserted at line 290 in
dlgdata.cpp.

cU
--
Dirk Djuga mailto:di...@solaris.stuttgart.netsurf.de
http://www.geocities.com/TimesSquare/1658/


Chris D

unread,
Jan 6, 1998, 3:00:00 AM1/6/98
to

Herbert,
Line 290 of dlgdata.cpp is
ASSERT(::GetWindowLong(hWndCtrl, GWL_STYLE) & WS_GROUP);
It looks like you forgot to set the WS_GROUP Style bit on the first
radio button in your Dialog.
Hope this helps,
Chris
Herbert wrote in message <34b203ac....@news.pacific.net.sg>...

>I am using VC Version 5.0 Enterprise version for almost half a month
>in this PC. When I run my application generated by VC5.0 It says :
>
>Title: Microsoft Visual C++ Debug Library
>Body:DEbug Assertion Failed!
>Program C:\MY_PROJ\CASH97\DEBUG\CASH97.EXE
>File: dlgdata.cpp
>Line: 290
>

Herbert

unread,
Jan 7, 1998, 3:00:00 AM1/7/98
to

It do to do w/ radio buttons.
There are two radio buttons "PUT" and "GET" in this dialog.
Once upon a time I checked/marked both radio buttons with group.
I found this and only checked/marked one of these radio buttons with
group. this error occured. When I check both again. It is OK.
In VC / Studio, How can I group these two radio buttons as a group?

I set member variables just after InitDialog(). That is:

BOOL ftp:OnInitDialog()
{
CDialog::OnInitDialog()

//TO DO
m_FTP_Get = 0;
m_FTP_Put = -1;
UpdateData( FALSE );

return TRUE;
}


Please E-Mail me as well.
Herbert yuh...@letterbox.com
|^^^^^^^^^^^^^^^^^|^^^^^^^^^^^^^^^^^^^^^^^|^^^^^^^^^^^^^^^^^^^^^^^|
| /_/ \/ | Herbert Yu | :-) Smile, Try it and |
| / / erbert / u | yuh...@letterbox.com | You will get it |
|_________________|_______________________|_______________________|

Herbert Yu Hai'an

unread,
Jan 7, 1998, 3:00:00 AM1/7/98
to Chris Depetris, Carole Zieler

It do with radio buttons.
There are two radio buttons in this dialog: PUT ans GET.
Once upon a time, I checked both radio buttons with group.
I corrected it after i found this error. And then this error happen.
I check both radio buttons again. It's OK.

How can I make these two radio buttons as one group?

By the way, I initialize my variable just after a call to
CDialog::OnInitDialog();
and then UpdateData( FALSE );

Please E-mail me as well

--

D. Zuppinger

unread,
Jan 7, 1998, 3:00:00 AM1/7/98
to

Herbert,
An ASSERT is used to ensure a certain value or condition meets the
requirement. It most of the time used to catch programming errors. For
example I write a method where I rely on the fact that my member has been
initialised. I then program the line ASSERT(m_var1 != NULL) before I use
that member. This way, in the debug version the programm will halt with the
Assertion Failed Dialog Box and give me the exact line position. I can then
follow it up and correct the problem as in this example, initialize my
variable.
In the Release version of the program this ASSERT will have no effect. If
my program does not have a problem whith my unititialised member, e.g. it
does not use it or it initializes it later, then my program works just
fine. If not you have a crash with little chance of finding it.
So it's good practice to use ASSERTS, specially for pointers.
But what when the damn thing happens deep, deep down in the MFC Code ? Now
that a easy way to find the problem (works most of the time). You run your
debug version and when it comes to a assert message you press RETRY. The
debugger will be invoked and points you the position where the assert is
programmed (Note that the line number is one above the pointer).
Normally you want to find out, from where your program delved into this MFC
Code. Open the Call Stack window and look at the list until you find the
first name of a method of your application. Double click, and you find the
caller. Here you need some more initialisation etc..

It looks like you have a problem with a dialog !?

Anyway, hope this helped.


--
Daniel Zuppinger
(Anti spam : remove the X'es and underline from my email address)
http://www.softtoys.com

Herbert <yuh...@letterbox.com> wrote in article


<34b203ac....@news.pacific.net.sg>...
> I am using VC Version 5.0 Enterprise version for almost half a month
> in this PC. When I run my application generated by VC5.0 It says :
>
> Title: Microsoft Visual C++ Debug Library
> Body:DEbug Assertion Failed!
> Program C:\MY_PROJ\CASH97\DEBUG\CASH97.EXE
> File: dlgdata.cpp
> Line: 290
>
> For infomation on how your program can cause an assertion failure, see
> the Visual C++ documentation on asserts.
> (Press Retry to debug the application)
> [Abort] [Retry] [Ignore]
>
> When I press retry Windows95 crushed " this program has performed an
> illegal operation and will shutdown" and my application closed and
> ended.
>
> When use "Win32 Release" rather than "Win32 Debug" in BUILD/SET ACTIVE
> CONFIGATION.
> No this problem
>
> my computer is P133 with 16m RAM and 1.2G hard disk(enough free hard
> disk) VC is the only task running
>
> Is that some DLL files damaged? or no enough RAM? This program is only
> a test of using FTP to GET and PUT files. Very easy one.
>

> Please E-mail me as well
>

> Herbert
> her...@ascom.com.sg
>
>

Vagif Abilov

unread,
Jan 7, 1998, 3:00:00 AM1/7/98
to

Herbert Yu Hai'an <yuh...@letterbox.com> wrote:

>It do with radio buttons.
>There are two radio buttons in this dialog: PUT ans GET.
>Once upon a time, I checked both radio buttons with group.
>I corrected it after i found this error. And then this error happen.
>I check both radio buttons again. It's OK.
>
>How can I make these two radio buttons as one group?
>
>By the way, I initialize my variable just after a call to
>CDialog::OnInitDialog();
>and then UpdateData( FALSE );

There are 4 things you should check:

1. Press Ctrl-D while in resource editor to see check the order of
controls. All radio buttons should be sequentially ordered.

2. The first radio button should have WS_GROUP attribute set.

3. None of other radion buttons should have WS_GROUP set.

4. The control which follows the last radio button (you can find which
one by clicking Ctrl-D) should have WS_GROUP style set.

Hope this helps.

Vagif Abilov
va...@online.no

Herbert

unread,
Jan 8, 1998, 3:00:00 AM1/8/98
to

Now I get the correct One! I share it out here to thank Vagif Abilov, Zuppinger,
Chris, Dirk Djuga and others.

It is a problem of ClassWizard, or not a problem, only not smart enough.

>On Wed, 07 Jan 1998 02:49:34 GMT, yuh...@letterbox.com (Herbert) wrote:
>Once upon a time I checked/marked both radio buttons with group.
And I use two variables with these radio buttons, then runed ClassWizard
to generate the class for this Dialog. The ClassWizard generated two lines
in DoDataExchange. After I uncheck PUT radio button's group style,
the ClassWizard is not smart enough to take out that line in DoDataExchange.
When I take it now, OK.

>Line 290 of dlgdata.cpp is
> ASSERT(::GetWindowLong(hWndCtrl, GWL_STYLE) & WS_GROUP);

Without group style, this line always produce zero!
and this line call from (indirectly) DoDataExchange

>So it's good practice to use ASSERTS, specially for pointers.

I will take this advice

>It looks like you have a problem with a dialog !?

Yes, I will work on it. Any suggestion on this topic? What I want is to
create a Dialog without one line in resource file. How do it?
Certainly I want MFC one, not SDK CreateWindowEx to create the controls
in dialog.

Thank all of you.

Herbert yuh...@letterbox.com

0 new messages