Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP app cannot instantiate COM+ component

Status
Not open for further replies.

entaroadun

Programmer
Sep 27, 2002
583
US
This is my first COM+ application, so please be gentle.

I created two ActiveX dlls for use in a COM+ application. The first is a business component and the second is a db component... pretty standard stuff.

I make extensive use of the ObjectContext and SecurityProperty objects, so I can't test my component outside of COM+. I tried enabling debugging for my COM+ app... that didn't go so well, and I don't feel like figuring out what the problem is.

The business component fails on initialization. I get an "Class does not support Automation or does not support expected interface" error. This happens both in a test Win32 exe and in ASP.

What is going on?

I know it's not a version compatibility problem, since both components are first builds. I know I added them into my COM+ app correctly because the component gave me a security error when I had not set up my roles properly. I know that the problem must be internal to either the business or db components, since the database component can be instantiated just fine.

The only thing I can think of is that I use GetObjectContext in Class_Initialize, but I'm using W2K SP2, which is supposed to have patched that bug over.

I am also using ADO extensively of course, in that same initialization routine.

Please help!
 
OK... I stripped out the COM+ specific code and added each layer back in until it failed. I found the specific line of code that causes the failure:

I use the GetOriginalCallerName of the SecurityProperty class. It returns the above error.

I've isolated the problem, but am at a loss as to how to fix it. Help!
 
OK...

The problem must have to do with using SecurityCallContext in Class_Initialize. Obviously, no call is being made at class initialization, so there is no DirectCaller. It seems Microsoft closed up the GetObjectContext bug without closing up GetSecurityCallContext in Class_Initialize; I can call the first (and use stuff like IsCallerInRole) but not call the second.

So how do I get the object creator's NT login name at Class_Initialize? This is the piece of info I need. Obviously, the object will not have a caller identity at initialization, but it does have a creator identity. How do I get at it? Why did Microsoft fix GetObjectContext but not GetSecurityCallContext?

Please help...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top