473,606 Members | 2,115 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Debug Assertion Failed!

i have a problem:
when i run a program,it pop up a windows,title is
microsoft visual c++ failed!
contents are:
program: ...io\myproject s\phonebook\deb ug\phonebook.ex e
file:fopen.c
line:54
expression: *file !=_T('\0')
for information on how your program can cause an assertion failure,see
the visual c++ doucmention on asserts.
(please retry to debug the application)
abort(A) retry(R) ignore(I)

can someone give me a suggestion ,where's the fopen.c what dose
*file !=_T('\0') mean,and where can
i get documentation on asserts?
ps. befor it occures,my program run at :
if (!fout.is_open ())
{
cerr << "Can't open file: " << fileName;
exit(EXIT_FAILU RE);
}
and if i select ignore
the cmd windows display Can't open filepress any key
to continue.
thanks a lot!
Aug 21 '08 #1
1 5795
On 21 Aug., 17:36, jerry <machel2...@yah oo.cnwrote:
i have a problem:
when i run a program,it pop up a windows,title is
microsoft visual c++ failed!
contents are:
program: ...io\myproject s\phonebook\deb ug\phonebook.ex e
file:fopen.c
line:54
expression: *file !=_T('\0')
for information on how your program can cause an assertion failure,see
the visual c++ doucmention on asserts.
(please retry to debug the application)
abort(A) retry(R) ignore(I)

can someone give me a suggestion ,where's the fopen.c *what dose
*file !=_T('\0') mean,and where can
i get documentation on asserts?
ps. befor it occures,my program run at :
* * * * if (!fout.is_open ())
* * * * {
* * * * * * * * cerr << "Can't open file: " << fileName;
* * * * * * * * exit(EXIT_FAILU RE);
* * * * }
and *if i select ignore
the cmd windows display Can't open filepress any key
to continue.
thanks a lot!
It tells you that you have passed a string of length 0 (the first
character is \0) as the filename to fopen.
assert should be described in your favourite C/C++ book - if it is
not, use google.

/Peter
Aug 21 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2016
by: Chemix | last post by:
Hello people, I've developed a windows forms application with VC++.NET. The problem I have is the next: I run my application and all seems go OK, but passed a certain time (it can be hours or some minutes), then a dialog window opens with the title:Microsoft Visual C++ Debug Library, and the next error: Debug Assertion Failed! Program: name of my program File: dbgheap.c Line: 1132 Expression: _CrtIsValidHeadPointer(pUserData)
2
3911
by: SorceCode | last post by:
Hey guys, good old > Debug Assertion Failed! > File: dbgdel.cpp > Line: 47 > Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse) Rears its ugly head agian! Ok heres what Im up to..
2
3894
by: w3r3w0lf | last post by:
hello! can anyone explain this to me? I get a "debug assertion failed" msg after some time in my prog...: file fclose.c, stream!=null thanks!
1
2751
by: Kapt. Boogschutter | last post by:
Does anyone know Why I'm getting this Error??? Debug Assertion Failed! File: daocore.cpp Line: 42 My code: CDaoDatabase dao; dao.Create("filename");
2
17598
by: Arti Potnis | last post by:
Hi, I have an application with a function "myfunction" that opens a file and writes to it using fprintf. This application runs on a unix (sun solaris 5.8) system. I connect to this application from a VB GUi on a windows 2000 system. The GUI invokes "myfunction". I get the following error:-
4
4294
by: A_StClaire_ | last post by:
I read a section of my text on smart "counting" pointers and found it confusing so I decided to get hands-on. however I'm getting "Debug Assertion Failed... Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)" whenever I run my code below. program works fine after I bypass the msg. any ideas? thx a lot.
2
8368
by: marat | last post by:
I have a managed c++ function below that makes a call to an unmanaged c++ dll .. This function is called from a C# app, resulting in a "Debug Assertion Failed dbgdel.cpp Line 52 Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)" errir message. This happens on function exit, looks like related to destruction of some vector. Any ideas why ????
4
13559
by: ellieong | last post by:
When i try to run my program, i get this error "debug assertion failed!" and it's caused by this file called "afxtempl.h" at line 262. isn't this header file provided by c++? so how can i get rid of this problem. if i click ignore i can see the output, but how can i get rid of such an error msg?
0
2931
by: lawrence | last post by:
Hi, I made a MFC ActiveX with a CwinThread Class in VC ++. Then i used it on Visual basic. When i try to make an exe i got this error : Debug Assertion Failed! Program: C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VB98\VB6.EXE File: cmdtarg.cpp Line: 52
4
9395
by: Mullai | last post by:
Hi , My program gives an error message like this Debug Assertion Failed! program:................ File: wincore.cpp Line: 958 Please can anyone help me out in this issue. I have to solve this bug immediately in my project.
0
8432
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8428
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8078
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8299
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5962
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5456
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3964
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2442
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1285
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.