|
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?
|
|
|
|
|
You must on the design mode set tab for controls press Ctrl+D then you can see some numbers for each control 1,2,12,13,... with click on each control you can set tab order.
|
|
|
|
|
When you create your "control with a base CWnd window" use CreateEx() instead of Create() and specify the first parameter dwExStyle with a value of WS_EX_CONTROLPARENT and any other extended styles you deem appropriate.
|
|
|
|
|
Hello Friends,
cam anbody tell me how to add the picture in the RichEdit box.
Thnx in advance.
|
|
|
|
|
|
Hello guyz.
I'm creating an MFC application, usually the output is application.exe but it won't run without VC++ installed. I want to make an exe file to distribute it without setup. Is it possible in VC++ 2003? If possible can somebody teach me how to do it.
Any message or comments would be a big help.
Thank you.
|
|
|
|
|
Compile your program in release mode and use DependencyWalker (search on google) to see which dll's are needed for your application. Distribute those dll's with your application.
You could also link statically to the MFC, then I think you don't need to distribute any dlls.
|
|
|
|
|
you can create folder and copy your 'exe' file to this folder and you must
copy to this folder 'dll' files that your program use.
and thats it. copy this folder to another PC and run you program,
but in this case you may get error message. (I get once error message. I forget one dll file)
|
|
|
|
|
Exactly his problem is he didnt know what files his program need so Cedric's answer is perfect.
|
|
|
|
|
Or maybe he is simply unaware of the concept of 'release build' and is missing mfc42D.dll.
We can't know since he did not give any information beyond a general nature of his problem.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|