--- Alan Williams <[EMAIL PROTECTED]> wrote:
> I am now converting the classes to ServicedComponents for COM+ 1.0
> primarily for transaction support and after several days work now find that
> apparently "Classes derived from ServicedComponent do not support
> constructors with arguments".

Look at IObjectConstruct - this is the COM+ way of doing constructors.  It might not 
be suitable
in your case since the arguments are set on a per class basis rather than per instance.

> It will be a lot of work to restore a parameterless New() to each class and
> then call an ordinary method instead from the instantiated object to set
> the properties. Our Web project is fairly large and component classes are
> instantiated in several hundred places.
> Am I resigned to doing this or am I missing something really fundamental?

You've just mentioned the solution!  (Remember to DisableCommit inside your Init 
function for JIT
activated objects.)

Sadly it's the COM and COM+ way to not have parameterised constructors.  You've got 3 
solutions
that I can think of:
1) Add an Init function.
2) Use IObjectConstruct (by the sounds of it this will be no good to you).
3) Drop COM+.  It may be easier to add transactions explicitly in your code.

Peter Foreman


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to