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.
> Hi TW,
>
[quoted text clipped - 22 lines]
> >
> > --TW
Marcus Heege - 12 Jul 2006 15:09 GMT
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
> This is what I started out assuming. I can successfully add my .NET
> component project reference to my client project and build.
[quoted text clipped - 88 lines]
>> >
>> > --TW
TW - 12 Jul 2006 15:26 GMT
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.
> 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
[quoted text clipped - 95 lines]
> >> >
> >> > --TW