473,467 Members | 1,307 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Error while registering the events on client side appl.

Hi,

I m getting the following error while registering the events on client
appl.
error:
"An error occurred creating the form. See Exception.InnerException for
details. The error is: Exception has been thrown by the target of an
invocation."
'My Coding
'---------client
Dim chan As HttpChannel
Dim serverProv As New BinaryServerFormatterSinkProvider
Dim clientProv As New BinaryClientFormatterSinkProvider
Dim props As IDictionary = New Hashtable
serverProv.TypeFilterLevel =
System.Runtime.Serialization.Formatters.TypeFilter Level.Full
props("port") = 0
'props("name") = "ChatApplication"
chan = New HttpChannel(props, clientProv, serverProv)
ChannelServices.RegisterChannel(chan, False)

theManager =
CType(Activator.GetObject(Type.GetType("InBetween. Manager,InBetween"),
"http://localhost:7777/ChatApplication"), InBetween.Manager)

AddHandler Me.theManager.evtReceiveText, AddressOf
Me.HandleReceivedMsg

'-----------------manager
Public Delegate Sub ReceiveText(ByVal username As String, ByVal text
As String)

Public Class Manager
Inherits MarshalByRefObject

Public Event evtReceiveText As ReceiveText

'-----------------server
public class Server

Public Shared Sub Main()
Dim server1 As Server
server1 = New Server()
End Sub

Public Sub New()

Dim chan As IChannel
Dim serverProv As New BinaryServerFormatterSinkProvider
Dim clientProv As New BinaryClientFormatterSinkProvider
Dim props As IDictionary = New Hashtable
serverProv.TypeFilterLevel =
System.Runtime.Serialization.Formatters.TypeFilter Level.Full
props("port") = 7777
'props("name") = "ChatApplication"
chan = New HttpChannel(props, clientProv, serverProv)
ChannelServices.RegisterChannel(chan, False)

RemotingConfiguration.RegisterWellKnownServiceType ( _
Type.GetType("InBetween.Manager, InBetween"), _
"ChatApplication", WellKnownObjectMode.Singleton)

Dim Manager1 As New Manager()
System.Console.WriteLine("Hit ENTER to exit...")
System.Console.ReadLine()

And one more thing is, I have copied the server.exe in C:\Inetpub
\wwwroot and before running client application, I have to double click
server.exe and run it. how to make it run automatically whenever any
client application starts. And can I use class library instead of
console application.

Thanks,
Shivkumar

Jul 19 '07 #1
0 1195

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Vince C. | last post by:
Hi. I'd like to trap ADO Recordset object events in my ASP script (either VBS or JS, no preference). I've tried (in VBS) writing a Sub rs_RecordChangeComplete( adReason, cRecords, pError,...
0
by: Efim | last post by:
Hi, I have got some problem with sending of events in .NET. I am using remouting. The client has got 2 objects for receiving different types of events (responses and events) The server has got...
5
by: Mong | last post by:
Hi, I have a webform with various asp controls on it such as textboxes and dropdownlists. I'm fairly new to asp.net coming from VB6 and am wondering when it's best to use client side events and...
2
by: Helen | last post by:
I've got some clientside script that runs when the selected index of a select box changes. Now I need to swap my selectbox with an ASP.NET radiobuttonlist (to solve some layout issues). I still...
5
by: Frank | last post by:
Hi, in a .net web appl (codebehind) when I push a button I want to do javascript stuff on the CLIENT side and then go on with the codebehind coding of the button (or maybe another proc) on the...
1
by: DaveS | last post by:
I am trying to capture the mouse click position in a datagrid but I get the following compilation error: Compiler Error Message: BC30002: Type 'System.Windows.Forms.MouseEventArgs' is not...
1
by: shivkumar2004 | last post by:
Hi!, I am developing a chat system using vb.net in vs 2005. I am getting the following error while registering the events. error details: System.InvalidOperationException was unhandled...
3
by: Mike | last post by:
Hi, I'm wondering if I can do this with ASP.NET?
9
by: Trapulo | last post by:
Hello, with ASP.NET 2.0 Ajax every unexpected error is managed client-side with a popup that reports the error to the user. In ASP.NET 3.5 this behavor has been changed: how can I have a similar...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.