Click here to Skip to main content
15,920,633 members
Home / Discussions / C#
   

C#

 
GeneralRe: Multy form question Pin
Saikat Sen27-Sep-03 12:21
Saikat Sen27-Sep-03 12:21 
GeneralRe: Multy form question Pin
I G 19827-Sep-03 19:17
I G 19827-Sep-03 19:17 
GeneralRe: Multy form question Pin
Jasper4C#27-Sep-03 23:16
Jasper4C#27-Sep-03 23:16 
GeneralRe: Multy form question Pin
I G 19828-Sep-03 2:34
I G 19828-Sep-03 2:34 
GeneralRe: Multy form question Pin
Jasper4C#28-Sep-03 5:13
Jasper4C#28-Sep-03 5:13 
GeneralRe: Multy form question Pin
I G 19828-Sep-03 19:57
I G 19828-Sep-03 19:57 
GeneralRe: Multy form question Pin
Jasper4C#29-Sep-03 9:31
Jasper4C#29-Sep-03 9:31 
GeneralRemoting and Interfaces Pin
jerrycainjr26-Sep-03 22:11
jerrycainjr26-Sep-03 22:11 
Everyone, I'm in the process of developing what can be accurately
called a chat system, and I'm running into a problem that I just can't figure out:

My client login window (the GUI elements themselves are typical, and I don't think
they're relevant) grabs hold of a remote factory object (subclass of MarshalByRefObject),
and that factory respects the following interface:

namespace MyCompany.Interfaces
{
public delegate void WelcomeEvent(string username);
public delegate void DismissEvent(string username);

public interface ISessionFactory
{
void OpenSession(string username, WelcomeEvent welcomeEvent, DismissEvent dismissEvent);
void CloseSession(string username, WelcomeEvent welcomeEvent, DismissEvent dismissEvent);
}
}

The connect button of my Login Window fires off the following delegate when clicked:

private void OnConnectButtonClicked(object sender, EventArgs e)
{
if (usernameText.Text.Length == 0) return;
string username = usernameText.Text;
RemotingConfiguration.Configure("client.config");
ISessionFactory factory =
(ISessionFactory) Activator.GetObject(typeof(ISessionFactory),
"http://localhost:5007/SessionFactory");
FriendsWindow buddylist = new FriendsWindow();
WelcomeEvent welcomeEvent = new WelcomeEvent(buddylist.WelcomeUser);
DismissEvent dismissEvent = new DismissEvent(buddylist.DismissUser);
factory.OpenSession(username, welcomeEvent, dismissEvent);
buddylist.Show();
this.Visible = false; // hide login window
}

When OnConnectButtonClicked is fired, I see a FileNotFoundException thrown from inside

buddylist.Show();

claiming that it can't find the ChatClient assembly, or the assembly of one of its dependencies.
Information relevant to the FriendsWindow class

FriendsWindow is a subclass of Form
Not surprisingly, it defined methods WelcomeUser and DismissUser, and each (as you
can see) are compatible with my WelcomeEvent and DismissEvent delegate types.
FriendsWindow and LoginWindow (the class defining the above) are both defined within
the same namespace.

It's defined within a project named ChatClient.csproj.
That project's default namespace: ChatClient (though all of my classes are
placed in a namespace I call MyCompany.ChatClient)
That project's assembly name: ChatClient

What's odd to me? If I comment out the factory.OpenSession() line, the program
properly displays my FriendWindow in response to the Show message. It's as
if the act of calling OpenSession causes the problem on the very next line.

I've not tried very much, because I'm still in that denial which allows me
to think that I'm right and that there's just a bug in the compiler. Smile | :)
However, I *have* inspected all of the namespace declarations and whatnot
to ensure that there're no typos, and as far as I can tell, there are none.

Any help or general comments as to where I should look for help would
be greatly appreciated.

Best,
Jerry


QuestionMDIchild layout? Pin
peenu26-Sep-03 19:01
peenu26-Sep-03 19:01 
GeneralRetrieving Image from SQLServer database Pin
Meysam Mahfouzi26-Sep-03 17:58
Meysam Mahfouzi26-Sep-03 17:58 
GeneralRe: Retrieving Image from SQLServer database Pin
peenu26-Sep-03 19:02
peenu26-Sep-03 19:02 
GeneralRe: Retrieving Image from SQLServer database Pin
Arjan Einbu27-Sep-03 1:23
Arjan Einbu27-Sep-03 1:23 
GeneralRe: Retrieving Image from SQLServer database Pin
Meysam Mahfouzi27-Sep-03 18:03
Meysam Mahfouzi27-Sep-03 18:03 
Generala Regular Expression question Pin
Meysam Mahfouzi26-Sep-03 17:51
Meysam Mahfouzi26-Sep-03 17:51 
GeneralRe: a Regular Expression question Pin
Blake Coverett27-Sep-03 2:29
Blake Coverett27-Sep-03 2:29 
GeneralRe: a Regular Expression question Pin
Meysam Mahfouzi27-Sep-03 17:58
Meysam Mahfouzi27-Sep-03 17:58 
GeneralRe: a Regular Expression question Pin
27-Sep-03 19:15
suss27-Sep-03 19:15 
GeneralRe: a Regular Expression question Pin
Meysam Mahfouzi28-Sep-03 1:59
Meysam Mahfouzi28-Sep-03 1:59 
GeneralProcesses and RedirectStandardOutput/Error Pin
Wjousts26-Sep-03 10:51
Wjousts26-Sep-03 10:51 
Questionhow to get the wwwroot's full path Pin
aw1ay26-Sep-03 10:33
aw1ay26-Sep-03 10:33 
Generalstrange unwanted strips in PictureBox Pin
israeli26-Sep-03 10:01
israeli26-Sep-03 10:01 
Generalopen directory and list files Pin
nisrinee5126-Sep-03 9:37
nisrinee5126-Sep-03 9:37 
GeneralRe: open directory and list files Pin
Saikat Sen27-Sep-03 12:26
Saikat Sen27-Sep-03 12:26 
GeneralRe: open directory and list files Pin
Anonymous27-Sep-03 12:32
Anonymous27-Sep-03 12:32 
GeneralRe: open directory and list files Pin
Wjousts27-Sep-03 13:29
Wjousts27-Sep-03 13:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.