Solved

More COM+ Problems

Posted on 2001-08-06
6
140 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

760 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

20 Experts available now in Live!

Get 1:1 Help Now