Re: How do I debug a process
"Tony Johansson" <t.johansson@logica.com> wrote in message
news:eaNOFCpPJHA.4224@TK2MSFTNGP04.phx.gbl...
Hello!
We have a C#.ASP.NET web application that runs on a IIS 6. The application
contains actually several asp pages but there is no GUI.
The application receive an xml file that is processed.
There is also an MFC dll that is called from this asp application to make
a
syntax check on quite many commands.
You don't have to know what a command is.
The problem that we get is the following when the asp pages calls the MFC
dll it will run into protected memory error.
The IIS runs on a windows server 2003.
We have also added some rows in the MFC dll to write to a file about where
in the
dll it is executing and also write some value for different variables.
We have also build the dll in debug mode and copied it to the windows
server
2003 and it will result in the same protected memory error.
Another thing that is of interest is that if we run the built-in
application
server in Visual Studio which exist by default we never get any kind of
error. Note I don't mean IIS here.
This is strange because when we run the built-in application server the
asp
will call the MFC dll but when we run it in this way we never get any
kind of problem.
We have also copied and change the asp pages to be runable in a windows
form
application which will call the
MFC dll and here we never get any kind of problem either.
Another very strange thing is that when we add statements to write to a
file
it might cause the application to work.
It sounds like your MFC DLL is stomping on memory somehow, and in some
environments it is being detected, and other environments it is not. To
debug, I think you can insert DebugBreak() statements into a function within
your MFC DLL that is being called, and you can then attach a debugger to the
native code of your MFC DLL.
-- David