Solved

More COM+ Problems

Posted on 2001-08-06
6
143 Views
Last Modified: 2010-05-02
Hi. Does someone know why, when transactions are activated, COM+ ALWAYS rise the same exception "Illegal procedure call or argument" no matter what error happens inside of a DLL????

It is a VERY hard problem. I cannot use exceptions to rise from VB, and makes very hard the debugging. It only happens when the transactions are active, i think...

Any clues?
0
Comment
Question by:Cuervo
  • 3
  • 3
6 Comments
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6356715
Return the error information by exposing it through the properties of the COM+ DLL

In your DLL...

Public Property Get ErrNo() as Long
   ErrNo = m_ErrNo
End Sub

Etc...


In Your Function

On Error Goto EH

...

EH:
  With Err  
     m_ErrNo = .Number
     m_ErrStr = .Desc
     .Clear  
  End With
End Function


Then in your ASP Page or whatever...

Dim ObjCom

Set ObjCom = Server.CreateObJect("YOurDLL.CLASS")

x = ObjCom.Function()
if objCom.ErrNo <> 0 Then
   with objCom
      msgbox .ErrNo, .ErrMsg
   End with
End if



   
0
 

Author Comment

by:Cuervo
ID: 6360696
Hi

Isn't supossed that is bad to have properties in COM+ DLLs?

But desestemating that... I can't believe that COM+ does this!!!!! it's offuscating!!!! Is this right???? Why the people of the magazines or the experienced programmers does not say anything?? No one told me of this anywhere and i think that is a pretty hard failure for this technology (if i'm not doing any mistakes and is not my fault, i cannot believe it)

There's no service pack or something for this??
0
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6360762
Nope sorry.  To return errors back to the calling application you have to expose them through properties.  It isn't your fault, just a limitation with COM+ & Microsoft.

And no it is not bad to expose properties in COM/MTS DLLs I have done it for years with no problems.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:Cuervo
ID: 6360850
But isn't ASP to be multithreaded? I thought that it was bad to mantain states in the DLLs within COM+.
0
 
LVL 8

Accepted Solution

by:
Dave_Greene earned 200 total points
ID: 6360881
You are only maintaining it long enough to see if an error occurred.  they you are removing it.
0
 

Author Comment

by:Cuervo
ID: 6360923
if there's no better solutions you will have the points. However, do you happen to have some paper or page where Microsoft talks about this problem? i would be very grateful if i have one.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…

856 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