Solved

More COM+ Problems

Posted on 2001-08-06
6
146 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: 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!

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month8 days, 17 hours left to enroll

617 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