Link to home
Start Free TrialLog in
Avatar of Cuervo
Cuervo

asked on

More COM+ Problems

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?
Avatar of Dave_Greene
Dave_Greene

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



   
Avatar of Cuervo

ASKER

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??
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.
Avatar of Cuervo

ASKER

But isn't ASP to be multithreaded? I thought that it was bad to mantain states in the DLLs within COM+.
ASKER CERTIFIED SOLUTION
Avatar of Dave_Greene
Dave_Greene

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Cuervo

ASKER

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.