Solved

More COM+ Problems

Posted on 2001-08-06
6
141 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA Excel: fill / replace values based on a config sheet. 5 61
Replace Formatted Numbers with text 9 61
Using "ScreenUpdating" 6 55
How does CurrentUser work? 10 31
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

863 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now