[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Interface For Network Chat And New Delivery System

Posted on 2006-06-13
12
Medium Priority
?
241 Views
Last Modified: 2011-09-20
Hello Perts,

Im developing a network Chat and new delivery system for our company network.

I have made all the back end of the chat protocol and was just after a point in the right direction for the client interface design

basicaly the clients listner is running in a thread started buy the main form with hass the list of contacts in a tree view.

when a user clicks a contact from the tree view it open a form ChatBox

this form sets its self up to point at the contact and send as the signed in user.

so far so good

this is the part that i need some guidance as best way of implemeting

when a message is recived (currently not what i want)

the Main form Listner thread of the recipient pulls in the message and opens a ChatBox form sets the details for sender and reciver so that the reciver can reply correctly.

ok still good

the problem is that if you already have a window open to the user you get a fresh one rather than an update to yours.

how can i detect if the ChatBox form is already open and if it has its recipeant set to that of the sender of the incoming message?

ok so at the main form listner thread when the message comes in i know in code the sender, the reciver, the message.

also onse i detect that the form ChatBox is already open and pointing at the sender of this new message. how do i update its message textbox from the main form? ie cross form update (deligate?...)

Any advice would be gratly appreciated.

Kind Regards, Clinton Storer.
0
Comment
Question by:clintons
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
12 Comments
 
LVL 14

Expert Comment

by:existenz2
ID: 16900876
You can keep up a list of all already opened chat windows to track down if somebody is already in a chat with you. This is very easy to implement: When a new ChatBox is opened save the username of the recieving end in the list and when the ChatBox is closed, remove it from the list.

I indeed think that a delegate is a tidy way to ensure that all ChatBoxes know there is a new message available. In the ChatBox recieving routine you'll need then to figure out if the message is meant for itself.
0
 

Author Comment

by:clintons
ID: 16907925
Ok so if i create a list system to keep track in the Main Form of the opened ChatForms eather from the user directly or reciving an incomming chat that should work. but when i recive a message for a chatBox that is already open how do i update the correct ChatBox? can i embed some marker when its created a pointer in the list or somthing?

Regards Clinton Storer.
0
 

Author Comment

by:clintons
ID: 16908941
The list system is now implemented and working for all desisions as to wether to open a new window or that a chat windows with that user should already be open

so the only problem now is updating the correct ChatBox form when its already open!

any help would be greatly apreciated.

Regards Clinton Storer.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 14

Expert Comment

by:existenz2
ID: 16909240
You indeed should do that with a marker which is contained both in the list as in the ChatBox form.
0
 

Author Comment

by:clintons
ID: 16931230
how can i do that?

how do i make a referance to a form? that i can create when its opened?
0
 

Author Comment

by:clintons
ID: 16932179
*In the ChatBox recieving routine you'll need then to figure out if the message is meant for itself.*

sorry i was a bit vuage the ChatBox Recieving routine is in the MainForm. MainForm recives all messages for all chat contacts. i need a way to post the message from MainForm to the correct ChatBox

Its done this way because the i push lots of other data to the mainform other than Chat Sessions (ie remote managment, invoke tuition remotly, map network drives, Deploy news and events, etc)

Regards Clinton Storer.
0
 
LVL 14

Expert Comment

by:existenz2
ID: 16932594
In the ChatBox form create a property which identifies the specific ChatBox, this can be a string, an integer, whatever as long as it is unique. Since you know which windows are open. you can iterate through all instances to check which chatbox window you need to post the message too from the main recieving routine.
0
 

Author Comment

by:clintons
ID: 16938795
I understand this concept but i dont now how to iterate through form instances? please give me some example code.

each ChatBox Has a string sContact which holds the contact that the active chat is open with.

MainForm recivecs a message for "bill" say i have 3 instances of ChatBox open, the first with its sContact = "tim", the second with its sContact = "bill", and the third with its sContact = "gary".

please provide the code to look through the running ChatBoxs checking sContact to test wether to deliver the Message to the Forms rtbMessage (rich text box) .

kind Regards,
Clinton Storer.
0
 
LVL 14

Expert Comment

by:existenz2
ID: 16942495
Just keep an array with all instances from the active chatboxes? That's all.
0
 

Author Comment

by:clintons
ID: 16947160
2 words

CODE EXAMPLE

0
 
LVL 14

Accepted Solution

by:
existenz2 earned 750 total points
ID: 16952757
ChatBox[] chatBoxes = new ChatBox[1];

foreach(Chatbox chatbox in chatBoxes) {
 if( chatBox.Reciever == recievedMessage.From) { // do something }
}


That's all...
0
 

Author Comment

by:clintons
ID: 16957045
Thank you, i used this method and changed it to suit. I was enough of a head start in the write direction.


Regards Clinton Storer.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question