|
You're simply trying to deallocate memory that you haven't allocated or isn't yours.
It could be a dangling pointer or something you've already deallocated.
Have a look at your call stack and follow it down to your own code where you presumably are calling delete on a pointer. Find out where this pointer gets its memory allocated, if anywhere.
A good thing is to assign NULL to pointers that you free up. That way you prevent at least one of the causes of the mentioned error to occur.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
Have a look at your call stack and follow it down to your own code where you presumably are calling delete on a pointer. Find out where this pointer gets its memory allocated, if anywhere.
how can i look the call stack can you explain me in depth ? how should i operate it?
Amit
|
|
|
|
|
amitmistry_petlad wrote:
when i close it the control goes the following file.
file:dbgdel.cpp
At this point your application has stopped its execution. Either the call stack window is visible or you can open it via the menu. In which menu you'll find it depends on which VS version you have.
In the call stack you'll see the call chain of the thread where the error occured. At the top of the call stack you'll find code in dbgdel.cpp according to your description above. Scroll down and you should see your own code, double click on a row that looks like your code and you'll be put at the statement in code where the call was made.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
open your debugger ; it's all there
|
|
|
|
|
You should learn to use your debugger, it is a really powerfull tool. To start it: press F5. You can then set breakpoints in your code by pressing F9 (this will set a breakpoint on the line which has the 'focus'). Once your code has crashed, you can open the call stack (it depends of which IDE you are using but it should be in the debug menu -> windows. You'll have to search a little bit for it).
|
|
|
|
|
amitmistry_petlad wrote: how can i look the call stack...
Ctrl+K.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
How to calculate the no.of characters entered in an edit box?
(i.e)As and when I entered one character, a method should return 1. Likewise,
a method has to return the no.of characters dynamically
|
|
|
|
|
T.RATHA KRISHNAN wrote: to calculate the no.of characters entered in an edit box?
See GetWindowTextLength()
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Do you have any variable for the edit box in question, e.g a control variable of CEditBox type or a CString ?
T.RATHA KRISHNAN wrote: Likewise,
a method has to return the no.of characters dynamically
What does "dynamically" mean? Each time the contents of the edit box are changed?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
T.RATHA KRISHNAN wrote: a method has to return the no.of characters dynamically
Can you explain about it
|
|
|
|
|
if using MFC appwizard
make a control variable for the edit control using the class wizard in the member variables tab
again, in class wizard, but this time in message maps tab, find the object ID (IDC_EDIT etc) used for your control in the object ID list, and on the right, click the "EN_CHANGE" message, then click "Add function" it will probably default name it to xxxOnChange()
find this xxxOnChange() function in your dialog code, and then count the characters in the edit box using GetWindowTextLength()
|
|
|
|
|
Hi Im writing an Addin for MS Outlook 2003 on VC++ .Net 2005. Actually I want acquire the handle of every new in coming Message/Mail from Exchange
server to MS Outlook Mail box. For that I am using Project type as New/Project/Other Project Types/Extensibity/Shared Add-in with ATL and
COM support. Until what i know is that every message contains it unique ID which is received from the Exchange Server. I want to get the message
pointer and using that I want to get the Message ID either in the Queue or Vector and then perform some specific task related to it.
So please can anyone tell what i can do for solveing this problem?.
Cheers
Ganesh
Ganesh Paul SPIAN
|
|
|
|
|
Hi, all
In the program given below i am supposed to read a file irrespective of the size of the buffer.
->i am not able to implement the reading of the file character by character
and then mention the EOF.
->how am i supposed to dot that??? what are the necessary changes required?
void CReadDlg::OnRead()
{
char szFilters[]="MyType Files (*.txt)|*.txt|All Files (*.*)|*.*||";
CFileDialog fileDlg (true,"txt", "*.txt",OFN_FILEMUSTEXIST| OFN_HIDEREADONLY, szFilters, this);
fileDlg.DoModal();
// TODO: Add your control notification handler code here
UpdateData( TRUE );
HANDLE hFile;
DWORD dwBufSize=BUFSIZE;
BOOL bRet;
DWORD dwBytesRead;
char buffer[BUFSIZE] = {0};
hFile = CreateFile(fileDlg.GetPathName(),
GENERIC_READ,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
bRet = ReadFile(hFile,
buffer,
BUFSIZE,
&dwBytesRead,
NULL);
/* while (!_eof(int fd))
{
buffer = */
m_ed = fileDlg.GetPathName();
m_text_ctrl.SetWindowText(buffer);
m_text_str = buffer;
UpdateData(false);
}
siddam
|
|
|
|
|
Check the return value from ReadFile() and the value of dwBytesRead to determine when EOF has been reached. GetLastError() may also return ERROR_HANDLE_EOF .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi
Does anyone know the commands to execute CreateProcess, so that the command window is hidden
im currently running
if(CreateProcess(sPath,lpszBuf, 0,0,FALSE,CREATE_DEFAULT_ERROR_MODE, 0,0, &siStartupInfo,&piProcessInfo) == FALSE)
thanks
simon
|
|
|
|
|
Doens't initialing STARTUPINFO-->wShowWindow with SW_HIDE helps you ?
|
|
|
|
|
prasad_som wrote: Doens't initialing STARTUPINFO-->wShowWindow with SW_HIDE helps you ?
i have tried that it didnt work for me, perhaps im calling it in the wrong place ??
STARTUPINFO siStartupInfo;
PROCESS_INFORMATION piProcessInfo;
siStartupInfo.wShowWindow = SW_HIDE;
memset(&siStartupInfo, 0, sizeof(siStartupInfo));
memset(&piProcessInfo, 0, sizeof(piProcessInfo));
siStartupInfo.cb = sizeof(siStartupInfo);
if(CreateProcess......
any ideas ??
|
|
|
|
|
si_69 wrote: memset(&siStartupInfo, 0, sizeof(siStartupInfo));
memset(&piProcessInfo, 0, sizeof(piProcessInfo));
You should call this before assigning values to structure.
|
|
|
|
|
prasad_som wrote: memset(&siStartupInfo, 0, sizeof(siStartupInfo));
memset(&piProcessInfo, 0, sizeof(piProcessInfo));
You should call this before assigning values to structure.
i have tried placing
siStartupInfo.wShowWindow = SW_HIDE;
before and after that, but still the same
|
|
|
|
|
si_69 wrote: siStartupInfo.wShowWindow = SW_HIDE;
You need to use StartUpInfo.dwFlags to make it effective,
StartUpInfo.dwFlags = STARTF_USESHOWWINDOW;
StartUpInfo.wShowWindow = SW_HIDE;
|
|
|
|
|
si_69 wrote: PROCESS_INFORMATION piProcessInfo;
siStartupInfo.wShowWindow = SW_HIDE;
Why use Initialize before memset
|
|
|
|
|
Hi all,
I need to be parse the XML file. So, please send any light weight XML parser library in Visual studio 2005.
Already I have been tried one XML parser. But there is some memory problem would arrive whenever run my application. The name of that one is "Apache's Xerces C++ Parser" by Fengjun Lv.
Thanks in advance
|
|
|
|
|
|
CMarkup [^] in an alternative to the TinyXML mentioned above.
The memory problem with Xerces is in your code?
Or are you working on a very small (128K RAM) machine?
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Hi jhwurmbach,
Now my machine has 256MB ram.I think problem should be from my code.
1. My application is some times work properly that is only when i rebuild my application and then run my application, Xerces gives a correct solution.
2. But,when i compile my App.. and then run my App.., only one or two value of attributes would be displayed,then "can't read memory location 77oxx8...Reading voilation.." will be displayed.
what is problem actually...
|
|
|
|