April 4th, 2003, 4:18 am
QuoteOriginally posted by: askI'd really rather avoid learning COM for this issue -- the time invested doesn't seem worth it. I don't think it's a name mangling issue. To create the DLL, I'm using C++ in Visual Studio with a .DEF file, and everything seems to be called OK. It literally seems that the <b>new</b> operator fails in rather trivial situations (e.g. defining a fixed length array of double), so I could do the error trapping, but I still wouldn't know what magic I should be doing to the heap to make this work. I can step into source code files such as xmemory, but all I learn is that my memory allocation failed. I'll try to produce a representative condensation of the code involved, so I can post it here.If you are in the debug mode in C++, memory management for new/delete will internally try to control/optimisation as a result of which even if you accidentally erase memory from the wrong pointer or the same pointer,I have seen that the error does not come at that point but will come at a very strange random place,but that place of failure is consistent each time you restart the application.One way to know if the error is really in the 'new' statement as you said,is to shuffle your code, or comment out chunks of code before you call this statement.I guessed that since Excel gets crashed,this might be due to access violation. Memory leak do not usually crash the application unless system resources go deplete.Access violation is caused if a pointer memory location is deleted twice,eg. if the pointer is an autoptr,as well as you delete it using delete statement and then it goes out of scope.Hope it helps,asd