|
|
There's also _access() , which is just a wrapper around GetFileAttributes() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello,
When I am debugging the source code,I got "Debug Assertion Failed" as a heading and the text which shown in big letters.
When I see the output i got the following messages.
=========================================================================================
Warning: data source is readonly.
DBMS: EXCEL
Version: 08.00.0000
ODBC Driver Manager Version: 03.52.0000
'omc.exe': Loaded 'C:\WINDOWS\system32\msjtes40.dll', No symbols loaded.
'omc.exe': Loaded 'C:\WINDOWS\system32\vbajet32.dll', No symbols loaded.
'omc.exe': Loaded 'C:\WINDOWS\system32\expsrv.dll', No symbols loaded.
'omc.exe': Unloaded 'C:\WINDOWS\system32\msexcl40.dll'
The thread 'Win32 Thread' (0x544) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xcd0) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x958) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x938) has exited with code 0 (0x0).
'omc.exe': Loaded 'C:\WINDOWS\system32\odexl32.dll', No symbols loaded.
'omc.exe': Unloaded 'C:\WINDOWS\system32\odexl32.dll'
'omc.exe': Unloaded 'C:\WINDOWS\system32\odbcjt32.dll'
'omc.exe': Unloaded 'C:\WINDOWS\system32\odbcji32.dll'
'omc.exe': Unloaded 'C:\WINDOWS\system32\msjter40.dll'
'omc.exe': Unloaded 'C:\WINDOWS\system32\msjint40.dll'
'omc.exe': Unloaded 'C:\WINDOWS\system32\msjet40.dll'
'omc.exe': Unloaded 'C:\WINDOWS\system32\mswstr10.dll'
HEAP[omc.exe]: Invalid Address specified to RtlValidateHeap( 02440000, 02DEBD00 )
Windows has triggered a breakpoint in omc.exe.
This may be due to a corruption of the heap, and indicates a bug in omc.exe or any of the DLLs it has loaded.
The output window may have more diagnostic information
========================================================================================
Please if anyone identifies the error let me know.
Thanks in advance
Ratheesh
|
|
|
|
|
Can you show your code that generates this error(dont need to post full code).
|
|
|
|
|
void FileNameCreate(LPTSTR szPathBuffer, LPTSTR sPath, LPTSTR sFile, LPTSTR sExt)
{
char szTmpPathBuffer[MAX];
char *sTmpPath= NULL;
char *sTmpFile = NULL;
char sTmpExt[LEN_MAX];
try
{
sTmpPath = new char[LEN_MAX];
sTmpFile = new char[LEN_MAX];
TrUnicodeToChar(sPath,sTmpPath);
TrUnicodeToChar(sFile,sTmpFile);
TrUnicodeToChar(sExt,sTmpExt);
FileNameCreate(szTmpPathBuffer, sTmpPath, sTmpFile, sTmpExt,sizeof(szTmpPathBuffer));
TrCharToUnicode(szTmpPathBuffer,szPathBuffer);
delete [] sTmpPath;
delete [] sTmpFile;
}
catch(bad_alloc)
{
if(sTmpPath!=NULL)
delete [] sTmpPath;
if(sTmpFile!=NULL)
delete [] sTmpFile;
}
}
Error message has been occurred only in the text is shown in big letters.
|
|
|
|
|
The code listing is incomplete (missing information on sTmpExt ), but my guess is that TrCharToUnicode(...) is overwriting the memory pointed to by szPathBuffer because it is not being told the size of the memory (in TCHAR s) being pointed to by szPathBuffer .
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
char to unicode means also that you need twice the amount of bits to store the output string.
Greetings from Germany
|
|
|
|
|
rajaratk wrote: When I am debugging the source code,I got "Debug Assertion Failed"...
What line of what file is asserting?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
When I debugging our application, I got the error messages in "output" window of VS2005.
'omc.exe': Unloaded 'C:\WINDOWS\system32\msjet40.dll'
'omc.exe': Unloaded 'C:\WINDOWS\system32\mswstr10.dll'
Run-Time Check Failure #2 - Stack around the variable 'sStr' was corrupted.
Run-Time Check Failure #2 - Stack around the variable 'sStr' was corrupted.
Run-Time Check Failure #2 - Stack around the variable 'sStr' was corrupted.
Also I got the popup message also:
"Run-Time Check Failure #2 - Stack around the variable 'sStr' was corrupted"
Please help me to solve this.
|
|
|
|
|
But where is the assertion?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
Thanks a lot for your response. I have added the code snippet which I got debug assertion failed error shown in bold letter:
============================================================
#define MAX 520
#define LEN_MAX 500
void FileNameCreate(LPTSTR szPathBuffer, LPTSTR sPath, LPTSTR sFile, LPTSTR sExt)
{
char szTmpPathBuffer[MAX];
char *sTmpPath= NULL;
char *sTmpFile = NULL;
char sTmpExt[LEN_MAX];
try
{
sTmpPath = new char[LEN_MAX];
sTmpFile = new char[LEN_MAX];
TrUnicodeToChar(sPath,sTmpPath);
TrUnicodeToChar(sFile,sTmpFile);
TrUnicodeToChar(sExt,sTmpExt);
FileNameCreate(szTmpPathBuffer, sTmpPath, sTmpFile, sTmpExt,sizeof(szTmpPathBuffer));
TrCharToUnicode(szTmpPathBuffer,szPathBuffer);
delete [] sTmpPath;
delete [] sTmpFile; }
=========================================================
LPTSTR TrCharToUnicode(char *CharBuffer, LPTSTR csBuffer, size_t uNbChar)
{
USES_CONVERSION;
if(CharBuffer == NULL)
return NULL;
else
{
if (uNbChar == 0)
uNbChar = strlen (CharBuffer)+1;
MultiByteToWideChar(CP_ACP, 0, CharBuffer, uNbChar, csBuffer, uNbChar);
return csBuffer;
}
}
=======================================================
Please give me some input to solve this issue.
Thanks in advance.
-- modified at 2:58 Monday 8th October, 2007
|
|
|
|
|
What line of what file is asserting (hint: it will contain an assert() statement)?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hai,
Thanks for your response. I got the following errors:
1. Windows has triggered a breakpoint in omc.exe.
This may be due to a corruption of the heap, and indicates a bug in omc.exe or any of the DLLs it has loaded.
The output window may have more diagnostic information
This is shown in the output window of VS2005
2. Run-Time Check Failure #2 - Stack around the variable 'sStr' was corrupted.
This one is display as popup window
3.Heap corruption detected at 02DF1B20
First-chance exception at 0x7c949fd5 in omc.exe: 0xC0000005: Access violation reading location 0xcdcdcdd1.
AtlThrow: hr = 0x8007000e
First-chance exception at 0x7c81eb33 in omc.exe: Microsoft C++ exception: CMemoryException at memory location 0x0011e370..
HEAP[omc.exe]: Heap block at 02DF18C0 modified at 02DF1B06 past requested size of 23e
Windows has triggered a breakpoint in omc.exe.
This may be due to a corruption of the heap, and indicates a bug in omc.exe or any of the DLLs it has loaded.
The output window may have more diagnostic information
This is shown in the output window of VS2005
Please give me solution to solve this
-- modified at 8:23 Tuesday 9th October, 2007
Now I got the following error message:
First-chance exception at 0x7c81eb33 in omc.exe: Microsoft C++ exception: CFileException at memory location 0x0012bdd4..
CFile exception: badPath, File d:\omc\omc610~1\omcpro~1\targprod\afr100\customer.dbs\test5test5test5test5test5test5test5test5test5test5test5test5test5test5test5test5test5test5test5test5test5test5test5test5test5test5test5test5test5test5test5test5test5test5test5test5test5test5test5test523.cdb, OS error information = 3.First-chance exception at 0x7c81eb33 in omc.exe: Microsoft C++ exception: CFileException at memory location 0x0012b0f4..
Load ACT: INSTALLER AB from d:\omc\omc610_rajaratk_priv_view\omcproject\targprod\afr100\ini\afr100a.ini
The thread 'Win32 Thread' (0xc1c) has exited with code 0 (0x0).
LockDataBase : The state of the object is signaled
The problem is that if I save the file name in 200chars it is accepting. But If i save the file name as 202 chars it will throw an exception. I have given the variable size upto 2000.
Please give me your suggestions to solve this issue.
|
|
|
|
|
The errors you show are (CFile ) exceptions. Does the path shown in the exception not mean anything to you?
For the fourth time, what line of what file is asserting?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
It shows the following error messages:
Debug Assertion Failed!
Program: d:\omc\OMC610_rajaratk_priv_view\omcproject\bin\debug\omc.exe
File: f:\sp\vctools\vc7libs\ship\atlmfc\include\atlsimpstr.h
Line: 877
Expression: nLength <= GetData() -> nAllocLength
For information on how your program can cause an assertion failure, see this Visual C++ documentation on asserts.
************************************************************************************************************
Debug Error!
Program :\omc\OMC610_rajaratk_priv_view\omcproject\bin\debug\omc.exe
HEAP CORRUPTED DETECTED: after Normal block(#45650) at 0x02E20BC8. CRT detected that the application wrote to memory after
end of heap buffer.
Memory allocated at f:\sp\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp
|
|
|
|
|
rajaratk wrote: Expression: nLength <= GetData() -> nAllocLength
From here you should be able to look at the stack frame to see how code execution got to line 877. It looks to be a string-related object.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
hi,
i have an image control 100x100 (icon style), i want to desplay an image of 32x32 stretched in to that control. how to do that ?
Thanks & Regards
|
|
|
|
|
I have seen a number of different "image" controls, some come with Visual Studio, some come from third parties. Without knowing which particular image control you are using I doubt anyone can answer the question.
|
|
|
|
|
i am using image control aavilable with visual studio.actually i want to stretch an HICON and i missed that in my question.
Thanks & Regards
|
|
|
|
|
Please refer StretchBlt[^] function.
Best Regards,
Suman
|
|
|
|
|
One thing about StretchBlt when use of it, it decreases quality of image.
|
|
|
|
|
well, duh! when you stretch a 32x32 image to a 100x100 image you will always loose quality.
|
|
|
|
|
Yes that's right with stretch(but I saw an article on the codeproject it used other function that you didnt have any change on your image) but if you have 100x100 image and want use of stretch to 32x32 image again you have loose quality
|
|
|
|
|
Check the LoadImage() API. In that API, you can specify the desider X and Y size no matter what the actual size.
|
|
|
|
|
I have designed a control with a base CWnd window and some CEdit childs in it. the childs have the WS_TABSTOP style. but when I press the tab button, nothing occurs (the focus is not changing between the childs). how should I solve the problem?
|
|
|
|