|
It means you're trying to delete (or free or some other heap allocation function) memory you shoudn't. Possible reasons;
- Freeing already freed memory;
- Freeing memory not allocated on the heap;
- Freeing an address in the middle of a heap block (e.g. delete ((new int[2])+1); ).
Steve
|
|
|
|
|
What line of what file is asserting? Without context, the error is rather meaningless.
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
_CrtISValidHeapPointer(pUserData)
To find out what's wrong with this line, declare pUserData as constant pointer and see where you get compiler errors.
|
|
|
|
|
An assertion is something the System Uses,(and you should also use them) to make sure that an assumption is actually the case. If it is not, it will throw an exception. In this case, if you use free(p), it assumes that p is a valid heap pointer. That assumption is tested, or asserted deep in the bowels of the code, and in this case it failed, pUserData is NOT a valid heap pointer.
Go back on the Call Stack to find out what is being freed, and take it from there
LateNightsInNewry
|
|
|
|
|
Hi.
I'm coding a c++ dll with visual studio 2005 and in my project configuration properties, the Common Language Runtime Support is set to "no".
What I want is to get executables which may run in every windows machine without the need of the .NET framework, and I was wondering if I'd need another IDE to do that.
Also I'm having problems mixing up a VB 6 program which uses a c++ dll compiled with vs2005. When I run the vb executable, it holds in the process list once it's close. Nevertheless, if I compile the same VB code with vs2005 and use it with the same dll, it all works like a charm.
If you don't know the answer, clues and tips are also welcome.
Thanks in advance.
|
|
|
|
|
You can write a component without .net frame work support using .net 2005 IDE. whatever settings u had given is correct only.
Regarding the vb6 issue, first of all i dont understand how could u compile vb6 application using .net2005. Because 2005 will convert ur vb6 project to a .net project which uses .net framework.
If u have process hanging issue with 2005 compiled dll, then it is better you go for vc++6 ide and compile the dll over there. The diffrence in C Runtime used by 2005 and vb6 can cause this problem. I auusme vb6 runtime will use C Runtime, not your vb6 application.
cheers...milton kb
|
|
|
|
|
Hi,
I want to check the system idle state, and want to do some operations on the idle time.
I had created a thread to check the system idle state.
My idle state conditions are
1. CPU usage must be less than 10%
2. There must be no load on the hard disc.
First condition is ok( I can use GetSystemTimes() to get the idle time...pls mention if any other suggessions )
But how can I check the hard disc load?
Regards,
Ajay
|
|
|
|
|
Im sure there are one (or more) performance counters that you can use for disk activity, if not, WMI might be able to help
'g'
|
|
|
|
|
yes u r rt and thanks 4 ur suggession.
I can use PDH APIs. But I want to know is there any way other than using PDH APIs.
And u mentioned about Windows Management Instrumentation. I don't have much knowledge abt it. Can u pls help me?
Regards,
Ajay
|
|
|
|
|
Ajaywinds wrote: I had created a thread to check the system idle state.
Why not just use GetLastInputInfo() ?
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
thanks 4 ur suggession.
Can u pls tell me how can I check the HDD load( other than PDH APIs )
Regards,
Ajay
|
|
|
|
|
Why not do the processing in a subthread created with the THREAD_PRIORITY_IDLE thread priority?
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
hi,
but I have my one idle conditions. How can I check that conditions like
1) whether the CPU utilization is less than 10%
2) whethter there is load on HDD
regards,
ajay
|
|
|
|
|
how do i export classes using regular dll?
because i donot want to use an extension DLL to export classes.
regards
Shailesh
|
|
|
|
|
how do i export classes using regular dll?
because i donot want to use an extension DLL to export classes.
regards
Shailesh
|
|
|
|
|
Shailesh Halankar wrote: how do i export classes using regular dll?
#define DllExport <code>__declspec( dllexport )</code>
class <code>DllExport</code> C
{
int i;
virtual int func( void )
{ return 1; }
};
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
Thanks for the INFO
how will the client import the exported class i.e wher should the __declspec( dllimport ) statement be used?
|
|
|
|
|
Shailesh Halankar wrote: wher should the __declspec( dllimport ) statement be used?
Replace dllexport by dllimport . Rest is the same.
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
Shailesh Halankar wrote: how do i export classes using regular dll?
because i donot want to use an extension DLL to export classes.
In continuation with Nibu, you have to include the lib and header file in your project!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
|
Hi All,
I want to write the contents of the edit box to file i have used this code but its not working can u tell me the cause..
i want to remove the old contetns and add the contetns of the edit box.
str holds the file name.
CStdioFile file(str, CFile::modeWrite);
file.Open(str);
char *pBuffer = new char[dwSize + 1];
m_FCONT.GetWindowText(*pBuffer);
UINT uWrite = file.Write(pBuffer, dwSize);
delete [] pBuffer;
Regards,
Vinay Charan.
|
|
|
|
|
you can use (CArchive /CFile)for your work
whitesky
|
|
|
|
|
Hi whitesky,
I have used CFile but i am nt getting how to save in the file can u plz c the code.
Regards,
Vinay Charan.
|
|
|
|
|
See one example Here[^] maybe it is some helpful to you
whitesky
|
|
|
|
|
and one simple example
<br />
CFile m_File("c:\\text2.txt",CFile::modeCreate|CFile::modeWrite);<br />
<br />
TCHAR buf[120];<br />
m_Edit1.GetWindowText(buf,sizeof(buf));<br />
m_File.Write(buf, lstrlen(buf));<br />
m_File.Close();<br />
whitesky
|
|
|
|