.NETGURU
Component doesn't unload
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.component_services.

Post a new message to this list...

Jay R.
Hi,

I've created 2 C# serviced components in a COM+ App dll. I register them and
they both work fine and unload OK when called from a VBScript, but when I
use one's object variable reference as an argument to the other in a method,
ie: (3rd line):

Set objvar1 = createobject ("My.Obj1")
Set objvar2 = createobject ("My.Obj2")
objvar1.objarg(objvar2)

then My.Obj1 won't unload when the script ends. It will, however, unload it
if I call:

Set objvar1.Dispose

but I would like VBScript to naturally unload it. My.Obj1 component locks a
file while it is running, and doesn't close it and unlock it until its
destructor is called, so the file remains locked and inaccessible. If my
VBScript happens to run into an unhandled error, then, and I cannot dispose
of the first object and this file remains locked for good (until I stop the
COM+ app)

I'm guessing this error has to do with remoting (object marshalling) or the
way COM+ handles objects passed as arguments, but I don't know beyond it.

Any way this can be fixed?

-Jay R

Reply to this message...
 
    
Jay R.
Workaround so far:

I created an additional public class within the namespace of the com+ app
which is not a serviced component. I use its methods and properties instead
of my service components, eg:

Set objvar1 = createobject ("My.Obj1")
Set objvar2 = createobject ("My.Obj2")
objvar1.objarg(objvar2.obj2)

objvar1 now accepts this class instead of objvar2 in its objarg method.

I don't like the syntax, I was hoping I could do it as I had written it
before. If anybody has a better idea, please post.

-Jay R.

"Jay R." <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
 




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification