473,503 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

debug assertion error in threads of c++ under windows

Hi All,

This my part of the c++ program using threads in windows :

//modified by pushpa
struct structExrdDoc
{
CExrdDoc* spDoc;
LPCTSTR sstrFileName;

structExrdDoc():spDoc(NULL),sstrFileName(""){}
};
structExrdDoc sp;

volatile bool running;

UINT CExcelExport::run(LPVOID p)
{
CExrdDoc* me = sp.spDoc;
me->OnSaveDocument ((LPCTSTR)sp.sstrFileName);
running = FALSE;
return 0;
}
//modified by pushpa

void CExcelExport::SaveExcelFile (CExrdDoc* pDoc, const string&
strFileName)
{
sp.spDoc = pDoc; //modified by pushpa
sp.sstrFileName = strFileName.c_str(); //modified by pushpa
running = TRUE; //modified by pushpa
AfxBeginThread(run,NULL); //modified by pushpa
//pDoc->OnSaveDocument (strFileName.c_str()); //modified by pushpa
}
Here the line of code I have commented was taking lot of time, so I hv
tried to use
threads and I am new to this.

This is the declaration in the .h file

static UINT CExcelExport::run(LPVOID p);

After some struggle I could compile the application, but when it is
run I am getting a
Debug assertion error.

debug assertion failed!
program:d:\amsa\amsa\bin\gageanalysisdlld.exe
file:wincore.cpp
line:888
for information on how your program can cause an assertion failure,
see the visual c++

documentation on asserts.

Could you please help me with this.

Thanking you in advance,
Pushpa.

Mar 9 '07 #1
2 5549
On Mar 9, 6:13 pm, "Pushpa" <pushpade...@gmail.comwrote:
Hi All,

This my part of the c++ program using threads in windows :

//modified by pushpa
struct structExrdDoc
{
CExrdDoc* spDoc;
LPCTSTR sstrFileName;

structExrdDoc():spDoc(NULL),sstrFileName(""){}};

structExrdDoc sp;

volatile bool running;

UINT CExcelExport::run(LPVOID p)
{
CExrdDoc* me = sp.spDoc;
me->OnSaveDocument ((LPCTSTR)sp.sstrFileName);
running = FALSE;
return 0;}

//modified by pushpa

void CExcelExport::SaveExcelFile (CExrdDoc* pDoc, const string&
strFileName)
{
sp.spDoc = pDoc; //modified by pushpa
sp.sstrFileName = strFileName.c_str(); //modified by pushpa
running = TRUE; //modified by pushpa
AfxBeginThread(run,NULL); //modified by pushpa
//pDoc->OnSaveDocument (strFileName.c_str()); //modified by pushpa

}

Here the line of code I have commented was taking lot of time, so I hv
tried to use
threads and I am new to this.

This is the declaration in the .h file

static UINT CExcelExport::run(LPVOID p);

After some struggle I could compile the application, but when it is
run I am getting a
Debug assertion error.

debug assertion failed!
program:d:\amsa\amsa\bin\gageanalysisdlld.exe
file:wincore.cpp
line:888
for information on how your program can cause an assertion failure,
see the visual c++

documentation on asserts.

Could you please help me with this.

Thanking you in advance,
Pushpa.
First of all if, possible remove the duplicate posts.

CExrdDoc* me = sp.spDoc;
me->OnSaveDocument ((LPCTSTR)sp.sstrFileName);

I really dint get how you assigned sp

Your code is not complete and run it in the debug mode. when the
program crashes, just break there and check the call stack. From there
you can identify which part of your code caused the problem.

Mar 9 '07 #2
On Mar 9, 6:13 pm, "Pushpa" <pushpade...@gmail.comwrote:
Hi All,

This my part of the c++ program using threads in windows :

//modified by pushpa
struct structExrdDoc
{
CExrdDoc* spDoc;
LPCTSTR sstrFileName;

structExrdDoc():spDoc(NULL),sstrFileName(""){}};

structExrdDoc sp;

volatile bool running;

UINT CExcelExport::run(LPVOID p)
{
CExrdDoc* me = sp.spDoc;
me->OnSaveDocument ((LPCTSTR)sp.sstrFileName);
running = FALSE;
return 0;}

//modified by pushpa

void CExcelExport::SaveExcelFile (CExrdDoc* pDoc, const string&
strFileName)
{
sp.spDoc = pDoc; //modified by pushpa
sp.sstrFileName = strFileName.c_str(); //modified by pushpa
running = TRUE; //modified by pushpa
AfxBeginThread(run,NULL); //modified by pushpa
//pDoc->OnSaveDocument (strFileName.c_str()); //modified by pushpa

}

Here the line of code I have commented was taking lot of time, so I hv
tried to use
threads and I am new to this.

This is the declaration in the .h file

static UINT CExcelExport::run(LPVOID p);

After some struggle I could compile the application, but when it is
run I am getting a
Debug assertion error.

debug assertion failed!
program:d:\amsa\amsa\bin\gageanalysisdlld.exe
file:wincore.cpp
line:888
for information on how your program can cause an assertion failure,
see the visual c++

documentation on asserts.

Could you please help me with this.

Thanking you in advance,
Pushpa.
Your code is not complete and run it in the debug mode. when the
program crashes, just break there and check the call stack. From there
you can identify which part of your code caused the problem.

Mar 9 '07 #3

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

Similar topics

0
2001
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...
6
595
by: Cormac | last post by:
Hi everyone, I'm writing Pure Data externals in C++ using Ms Visual C++ 7.0 and Windows2000. I'm running motions sensor hardware so there's a bit of real time data processing involved. When...
2
17584
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...
0
2901
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...
7
1399
by: Seko | last post by:
Hi! This is my first post here, so please excuse me for any mistakes I make. --------------------- I'm having a hard time displaying modal/non-modal dialog boxes in a Windows Forms...
4
9372
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...
0
326
by: Pushpa | last post by:
Hi All, This my part of the c++ program using threads in windows : //modified by pushpa struct structExrdDoc { CExrdDoc* spDoc; LPCTSTR sstrFileName;
1
4139
by: themadme | last post by:
im running code thats using threads, everytime i get this debug assertion failed box poping up. It involves with my stl vector. its saying that vector iterators incompatible. the vector...
0
1848
by: =?Utf-8?B?REx1ZWNr?= | last post by:
I am getting a debug assertion error that reads: Debug Assertion Failed! program E:\program files\internet explorer\iexplore,exe File: dbgheap.c Line: 1252 Expression:...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7287
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,...
0
7348
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...
0
5592
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5021
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...
0
4685
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...
0
3166
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
397
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...

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.