Re: Can RCW and CCW be used together?



It's actually VB.NET, so it is managed code. Since my main app has all
this code broken into multiple methods, this is a simpler way to test
(and describe) the problem.

The exception is thrown in the statement within the Try/Catch block
when I reference the PosXfeet property of my object, mc.

Marcus Heege wrote:
From your explanations it is not clear where the exception is thrown. The
code that you show seems to be VB6 code, but the exception must be thrown
somewhere in managed code.

Marcus

* w
"TW" <twestley@xxxxxxxxx> wrote in message
news:1152709966.708655.319160@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
This is what I started out assuming. I can successfully add my .NET
component project reference to my client project and build.

I can successfully create an instance of my .NET component via
automation calls to the ActiveX container. Then, I cast the created
object to my class. Upon accessing any property or method in this
object, I get a Remoting exception:

"This remoting proxy has no channel sink which means either the server
has no reg
istered server channels that are listening, or this application has no
suitable
client channel to talk to the server."

I can access properties and methods in the object returned from the
ActiveX container, just not on my object class. I can also access
properties and methods of non-.NET ActiveX controls provided by the
vendor after I've cast them to the right type.

Here's a snippet of VB code as an example of what I'm doing:

' Start IADS
Dim iads As IadsAutomationLib.Application
iads = CreateObject("Iads.Application")

' Load configuration
Dim iadsConfigFile As String
iadsConfigFile = "pfConfig"
iads.Configuration.LoadConfiguration(iadsConfigFile)

' Create an analysis window
Dim aw As IadsAutomationLib.AnalysisWindow
aw = iads.ActiveDesktop.AnalysisWindows.Add("Free Space View")
aw.WindowState =
IadsAutomationLib.IadsWindowStateType.iadsMaximized
aw.Visible = True

' Add an IADS Primitives item and test setting a property
Dim display As IadsAutomationLib.DataDisplay
display = aw.DataDisplays.Add("IadsPrimitives.IadsCircle", 0,
0, 100, 100, 0, "circle")
Dim circle As IADSPRIMITIVESLib.IadsCircle
circle = display.ControlUnknown
circle.TranslateX = 100

' Add my Cart control and set a property
display = aw.DataDisplays.Add("ITIP.IADS.MonitorCart", 0, 0,
100, 100, 0, "cart")
Dim mc As ITIP.IADS.MonitorCart
mc = display.ControlUnknown

' This will crash with Remoting exception
Try
Console.WriteLine(mc.PosXfeet)
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try

The only thing I'm doing to make my .NET component assembly work with
COM is to set "Register for COM interop" to true in VS.NET 2003.
Perhaps I'm missing something.

Thanks.

Marcus Heege wrote:
Hi TW,

COM interop is smart enough to not create a RCW that talks to a CCW to
talk
to your .NET object, but to give you a direct reference to the .NET
object
instead. There is no need to reference other things apart from your
problem-domain specific assemblies and the assemblies for the RCW-Interop
type info (e. g. the Primary Interop Assemblies).

Marcus Heege


"TW" <twestley@xxxxxxxxx> wrote in message
news:1152664093.591020.99900@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
We're C# .NET developers who must use an ActiveX container (not IE) to
create and contain our components. We'd like both the component and the
client to be C# .NET code.

But, it appears that you cannot do this. To do this, the RCW of my
client code would have to be able to talk to the CCW of my component. I
can't see how to do this. And, when I try to add my .tlb as a reference
to a .Net assembly, I get an error saying that a CLR assembly cannot be
used in this way.

Is there any solution short of changing the component code to C++ and
ATL? Is it possible to use .NET remoting to communicate between my .NET
client and .NET component even though it is an ActiveX container that
creates the component?

--TW



.



Relevant Pages

  • Re: Can RCW and CCW be used together?
    ... component project reference to my client project and build. ... Dim iads As IadsAutomationLib.Application ... problem-domain specific assemblies and the assemblies for the RCW-Interop ...
    (microsoft.public.dotnet.framework.interop)
  • Re: Can RCW and CCW be used together?
    ... code that you show seems to be VB6 code, but the exception must be thrown ... component project reference to my client project and build. ... problem-domain specific assemblies and the assemblies for the RCW-Interop ...
    (microsoft.public.dotnet.framework.interop)
  • How can .NET replace COM?
    ... Imagine an application, which is a COM server, where a client could get ... You can reference certain assemblies, ...
    (microsoft.public.dotnet.framework.interop)
  • Re: ASCII code
    ... Dim ch As Integer ... Dim s As String ... > I used to always remove the reference to Microsoft.VisualBasic. ... and then using ILASM to regenerate the assemblies. ...
    (microsoft.public.dotnet.languages.vb)
  • RE: Using .net windows user controls in to browser
    ... getting a reference from another assembly, client .Net will dynamically ... Actually, .Net locating algorithm is documented in MSDN, please refer to ... "How the Runtime Locates Assemblies" ...
    (microsoft.public.dotnet.framework.windowsforms)