Asp Com compnent Error-- 0192 (0x80004005)

Hi Experts
   i am developing a server Com component using VB
but when i execute this, i get an error on ASP page like this
'===============================================
ASP 0192 (0x80004005)
A trappable error occurred in the OnEndPage method of an external object.
'===============================================
i am creating  an object
         Server.CreateObject("MyCom.MyClass")  <--- This is another dll, registered on server
in my Com component code. this is causing the problem.
i traced MyCom.MyClass by placing code to write data to a file in some places in MyClass
and i found that control is passing throgh right path.
but after execution it returns this error.

Thanks in Advance
Shiju

LVL 14
Shiju SasidharanAssoc Project ManagerAsked:
Who is Participating?
 
sreeganeshConnect With a Mentor Commented:
Dear expert
delete the duplicate dll, and reregister server
in the Com component code.
i think this will solve the problem
0
 
Shiju SasidharanAssoc Project ManagerAuthor Commented:
'''''''''''''''''Here is my Component Code ''''''''''''''''''''
'        Project Name  - MyProject
'        Class Name    - TestClass
'==============================================================

Private Response As ASPTypeLibrary.Response
Private Request As ASPTypeLibrary.Request
Private Application As ASPTypeLibrary.Application
Private Server As ASPTypeLibrary.Server
Private Session As ASPTypeLibrary.Session
Dim objLink

Public Sub OnStartPage(SC As ScriptingContext)
    Set Session = SC.Session()
    Set Response = SC.Response()
    Set Request = SC.Request()
    Set Server = SC.Server()
    Set Application = SC.Application()
End Sub
 
Public Sub OnEndPage()
    Set Session = Nothing
    Set Response = Nothing
    Set Request = Nothing
    Set Server = Nothing
    Set Application = Nothing
End Sub
Public Sub MySub()
On Error GoTo Last:
'-------- If i Remve these statements it works    -----
    Set objLink = Server.CreateObject("MyCom.MyClass") '<--- This is another dll
                                                     'which is registered on the server
    CallByName objLink, "TestValue", VbLet, "Test Value"
    CallByName objLink, "Show", VbMethod
    Set objLink = Nothing
'--------
Last:
If Err.Number <> 0 Then
    EventLog "C:\MainSub.txt", 6, , Err.Description
    Err.Clear
End If
End Sub
'==============================================================
0
 
Shiju SasidharanAssoc Project ManagerAuthor Commented:
>>EventLog "C:\MainSub.txt", 6, , Err.Description
simply writes error messge to a file
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Shiju SasidharanAssoc Project ManagerAuthor Commented:
'''''''''''''''''Here is my ASP Code ''''''''''''''''''''

<%
      Dim objCOM
      Set objCom = Server.CreateObject("MyProject.TestClass")
      objCom.MySub
      Set objCom = Nothing
%>
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
0
 
babuno5Commented:
i hope this solves the problem

Public Sub MySub()
On Error GoTo Last:
'-------- If i Remve these statements it works    -----
Dim objLink As MyCom.MyClass
    Set objLink = New  MyClass


'   just make sure is this syntax  correct --> CallByName objLink, "TestValue", VbLet, "Test Value"
' we usually call functions as objLink.functionname(parameteres)
    CallByName objLink, "TestValue", VbLet, "Test Value"
    CallByName objLink, "Show", VbMethod
    Set objLink = Nothing
'--------
Last:
If Err.Number <> 0 Then
    EventLog "C:\MainSub.txt", 6, , Err.Description
    Err.Clear
End If
End Sub
0
 
Shiju SasidharanAssoc Project ManagerAuthor Commented:
hi
thank u for the comment
>> we usually call functions as objLink.functionname(parameteres)
           objLink.TestValue = "Test Value"
           objLink.Show
yes, i tried that already but got the same error.
control passes through all these lines but at the end i get this error  Error-- 0192 (0x80004005)
pls help...
0
 
Shiju SasidharanAssoc Project ManagerAuthor Commented:
Hi sreeganesh
  Thank u for the comment
 i tried ur idea, but that doesnt seem to work.
0
 
PaulHewsCommented:
MS suggests you use ObjectContext instead of OnStartPage/OnEndPage

Creating Visual Basic COM Components for ASP
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk/html/503e9edf-489c-4e54-a076-4c519ef6a649.asp


0
 
PaulHewsCommented:
If you don't want to commit to going the ObjectContext way, I would also consider trying the following:

-Leaving out the OnEndPage event... These object references will end when the component is set to Nothing in your ASP page.  See this: http://www.devx.com/vb2themax/Tip/18457

-Renaming your objects
Private mResponse As ASPTypeLibrary.Response
Private mRequest As ASPTypeLibrary.Request
Private mApplication As ASPTypeLibrary.Application
Private mServer As ASPTypeLibrary.Server
Private mSession As ASPTypeLibrary.Session

It's usually not a good idea to name a variable after a global class.
0
 
Shiju SasidharanAssoc Project ManagerAuthor Commented:
hi
@PaulHews
    Thank u, those links were helpful

@sreeganesh
  Thank u ,  u were right , iis was not releasing the things when i tried.
it got right when i stopped iis completely tried with modified dll
reregistration did the job

Thank u all

;-)
Shiju
0
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.