[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Asp Com compnent Error-- 0192 (0x80004005)

Posted on 2005-05-07
10
Medium Priority
?
804 Views
Last Modified: 2007-12-19
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

0
Comment
Question by:Shiju Sasidharan
10 Comments
 
LVL 14

Author Comment

by:Shiju Sasidharan
ID: 13950630
'''''''''''''''''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
 
LVL 14

Author Comment

by:Shiju Sasidharan
ID: 13950640
>>EventLog "C:\MainSub.txt", 6, , Err.Description
simply writes error messge to a file
0
 
LVL 14

Author Comment

by:Shiju Sasidharan
ID: 13950643
'''''''''''''''''Here is my ASP Code ''''''''''''''''''''

<%
      Dim objCOM
      Set objCom = Server.CreateObject("MyProject.TestClass")
      objCom.MySub
      Set objCom = Nothing
%>
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 15

Expert Comment

by:babuno5
ID: 13955156
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
 
LVL 14

Author Comment

by:Shiju Sasidharan
ID: 13957460
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
 
LVL 2

Accepted Solution

by:
sreeganesh earned 2000 total points
ID: 13958728
Dear expert
delete the duplicate dll, and reregister server
in the Com component code.
i think this will solve the problem
0
 
LVL 14

Author Comment

by:Shiju Sasidharan
ID: 13961856
Hi sreeganesh
  Thank u for the comment
 i tried ur idea, but that doesnt seem to work.
0
 
LVL 38

Expert Comment

by:PaulHews
ID: 13972376
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
 
LVL 38

Expert Comment

by:PaulHews
ID: 13972466
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
 
LVL 14

Author Comment

by:Shiju Sasidharan
ID: 14013199
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question