OnEndPage method failed


  I am using one of my ActiveX Server components (developed with ATL COM wizard in Visual C++). But when I try to run it, I get the following error,

error '800706be'
/dencom_web/detailed_workload/duane.asp, line 10
Active Server Pages error 'ASP 0194'
OnEndPage Failed
An error occurred in the OnEndPage method of an external object.

Any ideas as to how to fix this error?
Who is Participating?
jitgangulyConnect With a Mentor Commented:
Not very sure. But look for the code in OnEndPage. May be you are trying to destroy an (multiple) objects which does not exists. What is there in line 10 ?
MSDN says
"You must use the OnEndPage method to free copies of objects stored by the OnStartPage method and any other resources that do not need to persist beyond current script processing."

So may be some of the objects are already freed and and your are trying to free it again. Check that in OnEndPage code
dbdoshiAuthor Commented:
Actually, I have a user defined function in my component. When this method
is minimal, it does not give me the error, but when I do lot of stuff (like socket connections, string
manipulations, file I/O) it is giving me the error.

My OnEndPage code is as below. I have not made any changes to the default code provided by the wizard.

STDMETHODIMP Cdoshi::OnEndPage ()  
     m_bOnStartPageCalled = FALSE;
     // Release all interfaces

     return S_OK;
dbdoshiAuthor Commented:
Thanks. Actually the error was in my user defined function (when I was manipulating strings) and I was not handling memory allocations well. But somehow the error was returned as being in the OnEndPage method.
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

WHy C ?
I know I could not give you a proper solution, but then you could delete this q. Getting a 'C' is insult ( at least I think it that way). Rememebr this is a free service and I spent some tiem to solve your problem.
Please ask CS to change the grade to A or B or I will ask them to change this from my answer history
dbdoshiAuthor Commented:
Hey, the grade is no way related to your knowledge.. :) I know you answer a lot of questions ( probably some of mine in the past) and your help is truly appreciated. I gave a "C" not because of I suspected your answer, but the problem was completely unrelated to the solution. I did not delete the question because you DID HELP.. :) But sure, if you want B or A, please go ahead and get it changed. I don't mind it. Sorry, if it seemed insulting, that was not my intention.
Hi dbdoshi,

Thank you for your response. If something like that happens, don't hesitate to post a question in CS. We can help you do things that you cannot normally do in EE, like reduce the points, for example.

In this case it might be a good idea to reduce the points..... You decided the give jitganguly a "C", which gives 'em 50 points. What I will do is reduce the points to 13, and change the grade to "A". That way, jitganguly still gets the same 50 (well, 52) points, you get some of your points back, the grade is better, and everyone's happy.....

In short, don't be afraid to ask for assistance, I'll be happy to help.

Community Support
Thanks modder
dbdoshiAuthor Commented:
Hello Modder,

  Please award jitganguly a "B". In hindsight, his answer is correct, though unrelated to my problem. Thanks.

Maybe you should add to your profile:
"If you try helping me, you will be punished."
dbdoshi.  <<Mental note "a name to remember">>
Actuall, would you mind deleting this Q from my history. It will make both of us happy.
dbdoshiAuthor Commented:
Hey, John844 and ameba, you guys are out of your minds. Here I am being considerate and you seem to be taking this too far, I already asked to give the grade as jitganguly wanted, so John588, you want to remember my name, well go ahead, **** you.
dbdoshiAuthor Commented:
I really don't understand why are people getting all riled up for?? If you care to read my earlier posting, you will notice that I already apologized and asked for the grade to be changed. Even Modder appreciated my response. Now these two, John844 is threatening me... John844, eat your words, will ya??
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.