Mike,

The property that I am accessing is actually just a public function.
Here is the code for my test class :

Imports System.EnterpriseServices
Imports CTRL
Imports System.Threading

<Assembly: ApplicationActivation(ActivationOption.Server)> 
<Assembly: ApplicationName("SimpleTrans")> 
<Assembly: Description("Simple Transactional application to show
Enterprise Services")> 
<Assembly: ApplicationAccessControl(False)> 
' <Transaction(TransactionOption.RequiresNew)> _
Public Class VBServCom
    Inherits EnterpriseServices.ServicedComponent

    Private oLib As CTRL.Library

    ' Shows Explicit SetComplete/SetAbort.
    Public Function DoTrans() As String
        Dim name As String
        name = "this is a test"
        DoTrans = name
    End Function


    Public Function GetLibrary() As Object

        oLib = New CTRL.Library ' make a new Library object

        GetLibrary = oLib  ' finally, return the Library object ...

    End Function 

    ' Show implicit SetComplete/SetAbort.
    <AutoComplete(True)> _
    Public Sub DoTxAuto()
        'Do stuff
    End Sub

End Class


My clients code is the following :

Imports ServicedCOM.VBServCom

Module Module1
    Sub Main()
        Dim o As ServicedCOM.VBServCom
        Dim s As String
        Dim oLibrary As CTRL.Library

        o = New ServicedCOM.VBServCom
        s = o.DoTrans
        Console.WriteLine("Result was : " & s)

        oLibrary = o.GetLibrary()

        Console.WriteLine("Result was : " & oLibrary.Version)

    End Sub
End Module

So I am getting the error when I try and execute the oLibrary.Version
method.  The o.GetLibrary() call executes but I'm not sure its returning
anything useful.  Also, the CTRL.Library object inherits from
MarshalByRef so I know it can be remoted.   I didn't think that I had to
setup channels or sinks when using Component
Services/EnterpriseServices.  I know how to do this when doing remoting
but I'm not sure how it would work in the Component
Services/EnterpriseServices configuration.

Thanks,
Nick




-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Mike Woodring
Sent: Thursday, January 04, 2007 7:42 PM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] Passing an object reference back from a
COM+ hosted object

> The call to the new method worked,
> but when I try and reference a property of the object that I just got 
> passed back, I get the following error :

What's the type of the property you're accessing, and are you accessing
it's setter or getter?

-Mike
Bear Canyon Consulting LLC
http://www.bearcanyon.com
http://www.pluralsight.com/mike

===================================
This list is hosted by DevelopMentor(r)  http://www.develop.com

View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to