|
That's way too much to answer in a single post. You're asking the layout of a complete (commercial!) project? Expecting that anyone 'ere would simply post it?
You could start with downloading the Coding4Fun Kinect Toolkit[^] and studying it.
Bastard Programmer from Hell
|
|
|
|
|
I have written an Outlook 2007 Add-In using Visual Studio 2010 and C# (.NET 4.0). All is well most of the time but I encounter a crash in Outlook once in a while. When the crash occurs it is ONLY when Outlook is disconnected from the Microsoft Exchange server. My work laptop connects wirelessly and my job requires that I connect to two different local wireless networks, depending on the task(s) which I must complete. While on the primary network, Outlook is connected to my employer's MS Exchange server. On the other network, it disconnects (goes into Offline mode). Every once in a while, when disconnecting from the primary network, Outlook crashes, though not every time.
Below is the only code which is executed by the add-in. It runs periodically (every ten minutes).
private void CheckFolderItemsMU(Outlook.Folder folder)
{
if (folder.Folders.Count > 0)
{
foreach (Outlook.Folder f in folder.Folders)
CheckFolderItemsMU(f);
}
if (folder.DefaultItemType != Outlook.OlItemType.olMailItem) return;
if (folder.Name == "Deleted Items" || folder.Name == "Sent Items" || folder.Name == "Outbox") return;
if (folder.Parent.Name != "*COMPANYNAME*") return;
Outlook.Items items = folder.Items;
Outlook.MailItem mailItem = null;
foreach (object collectionItem in items)
{
mailItem = collectionItem as Outlook.MailItem;
if (mailItem != null)
{
string subject = mailItem.Subject.ToUpper();
subject = subject.Replace("FW: ", "");
subject = subject.Replace("FWD: ", "");
subject = subject.Replace("RE: ", "");
if (mailItem.SenderName == "*NAMEOMITTED*")
{
if (string.IsNullOrEmpty(mailItem.Categories))
mailItem.Categories = "*NAMEOMITTED*";
}
else if (mailItem.SenderName == "*NAMEOMITTED*")
{
if (string.IsNullOrEmpty(mailItem.Categories))
mailItem.Categories = "LPS Data";
}
else
continue;
if (mailItem.IsMarkedAsTask) continue;
if (mailItem.Importance != Outlook.OlImportance.olImportanceHigh)
mailItem.Importance = Outlook.OlImportance.olImportanceHigh;
mailItem.MarkAsTask(Outlook.OlMarkInterval.olMarkToday);
mailItem.TaskStartDate = DateTime.Now;
mailItem.TaskDueDate = DateTime.Now.AddHours(1);
if ((DateTime.Now.Hour > 14) && (DateTime.Now.Minute > 45))
{
DateTime dateDue = DateTime.Now.AddDays(1);
if (dateDue.DayOfWeek == DayOfWeek.Saturday) dateDue = dateDue.AddDays(2);
else if (dateDue.DayOfWeek == DayOfWeek.Sunday) dateDue = dateDue.AddDays(1);
dateDue = new DateTime(dateDue.Year, dateDue.Month, dateDue.Day, 7, 0, 0);
mailItem.TaskDueDate = dateDue;
}
else
mailItem.TaskDueDate = DateTime.Now.AddMinutes(20);
mailItem.Save();
}
}
}
Is there anything here which appears to be a problem while Outlook is in Offline Mode?
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|
|
Matt U. wrote: Is there anything here which appears to be a problem while Outlook is in Offline Mode?
How about catching the exception and logging it? Might give a nice hint on why it's crashing.
Bastard Programmer from Hell
|
|
|
|
|
Oh my. That was a complete fail. I have no idea why I did not do that to begin with. I figured it out. It was the line "if (folder.Folders.Count > 0)".
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|
|
Matt U. wrote: I have no idea why I did not do that to begin with.
Happens when you're busy, working people tend to make mistakes from time to time. Good to hear that you already fixed it
Bastard Programmer from Hell
|
|
|
|
|
Hi Guys,
I need to be able to format the text displayed by a CheckBox or RadioButton to show specific words within the text as bold, underline and/or italic. HTML would make this easy but I haven't been able to find any controls of this type that offer anything other than plain text properties.
Could anyone offer suggestions to solve this problem? I'm open to commercial component libraries (if they come with source) or to writing a custom component. If my only option is a custom component, a suggestion of an article/tutorial on the OnPaint method would be great.
Thanks...
|
|
|
|
|
The standard button won't do this. If a quick search hasn't turned it up already, you may have to do it yourself. Custom painting a check box is a bit tricky because you still want the OS to draw the box for you, but not the label.
|
|
|
|
|
When you say "format" are you describing something going on at run-time where someone using your application can change the color, font, style, etc. on-the-fly ?
"Beauty is in the eye of the beholder, and it may be necessary from time to time to give a stupid or misinformed beholder a black eye." Miss Piggy"
|
|
|
|
|
No. I will be creating the component at run-time, populating the text and positioning the component on a form. I'm creating a questionnaire with a varying # of multiple choice answers. Some of the available answers will have words that are bolded, etc.
Example:
Q: Are you here?
A : Yes Always
B : No Sometimes
C : Not Sure
|
|
|
|
|
Since you know the formatting of the questions in advance ... I'd consider:
1. possibly using a WebBrowser control
2. creating a UserControl (Luc beat me to it, as usual) that combines either an actual CheckBox, or a simulation of a CheckBox, with a RichTextControl.
3. doing some research here on CP (and StackOverFlow[^]) for WinForms controls that can render the subset of HTML you need (I do think there are some here on CP). And, naturally, Google[^].
best, Bill
"Beauty is in the eye of the beholder, and it may be necessary from time to time to give a stupid or misinformed beholder a black eye." Miss Piggy"
modified 28-Sep-11 10:53am.
|
|
|
|
|
As a standard CheckBox/RadioButton won't do that, you need something else, maybe an aggregation of two existing Controls. How about a RadioButton-without-text and something (a Panel, a RichTextBox, a WebBrowser) where you get the text any way you want it?
The drawback now is it's click area will not cover your text. A possible remedy is to have a RadioButton-with-text where ForeColor equals BackColor, effectively hiding its text. The other control then needs to be click-through, which probably simply means disabled. Another possibility is you execute a RadioButton.PerformClick inside the Click handler of your text displaying Control.
|
|
|
|
|
You could put one of these[^] labels next to the checkmark. Don't forget to hook up the keyhandler to toggle the checkbox when the label has focus and the user presses the space-bar.
Bastard Programmer from Hell
|
|
|
|
|
I am new to SIP and i have been the Lumisoft examples for SIP Call Out and SIP UA. I am having a big problem making a call. I can call another SIP client and the call will be received. However, my application does not recognize the response form the other end. For example, even if the call is picked from the other end, my application still keeps on ringing.
About the incoming call, from wireshark, i can see that the call is going through but the application does not seem to be noticing this. Has anyone used this API? Kindly help me know how i can listen on the incoming calls, especially that. And how can i ensure that the response is well received on my end to ensure that if someone accepts a call, i can actually initiate a dialog?
|
|
|
|
|
There are lot of client/ Server tcp chat program but they all are doing broadcasting.
I want a program where i can talk to a specific client-to-client.
I know there is
serverSocket.LocalEndPoint and
serverSocket.RemoteEndPoint which can be used.
Is there any good article or program which I can use as reference to develop this program
|
|
|
|
|
There are lots to be found through Google[^], but you may need to read through a few to get one that matches your exact needs.
|
|
|
|
|
nitin_ion wrote: I want a program where i can talk to a specific client-to-client.
There are some articles here in CP about chat applications that support private messaging, if that's what you mean. Take a look.
A Complete TCP Server/Client Communication and RMI Framework - Usage[^]
LanTalk[^]
Or you can choose what you need on the list of articles here[^]
Signature construction in progress. Sorry for the inconvenience.
|
|
|
|
|
The server needs to hold a map of client sockets to user names, and then when you request chat to a particular user, the server looks up the socket and sends a message only to that one.
My lobby server does this by using the socket ID number and storing user information including that ID. Joining a game, chatting within a game or PMing another user use the member IDs to route messages. But (i) that uses my socket library and (ii) does a lot more than just this, so it may not be a good example.
|
|
|
|
|
Since socket is internetwork and they all are connected to server with same port and IP.
When i try to send message to a particular client using RemoteEndPoint and IPAddress
var ip = new IPEndPoint(i, j) it still send messages to all clients.
Then how can i connect to a client?
|
|
|
|
|
A client will always send data down the same socket (to the server). It must put something in the message to indicate its target, and the server needs to look at the message to decide what to do with it.
|
|
|
|
|
So if i send the target to server along with message, the problem still remain the same.
should then i use <pre>var ip = new IPEndPoint(i, j)</pre> with port as RemoteEndPoint and then use <pre lang="c#">SendTo(Message, Address)</pre> to send.
is that what you are saying?
|
|
|
|
|
In the server, look at the message that the client sends. If it specifies a particular target for the message, look that client up in the list of currently connected clients (by ID number, username, etc), and send to that socket.
Note that this is not really 'client to client' (peer-to-peer), you are still chatting through the server. TCP is always client-server. You could have each instance of the chat app try to start a server and connect directly between users, but that's usually not what people want – they want to be on one server with lots of people but be able to send messages to only a subset of them. That's server side logic and you need to write it.
|
|
|
|
|
Thanks, I have done some changes to the server code and now it is sending it to particular client if it is there.
But there has to be some nmodel where peer to peer is poosible may b using some othe protocol but i guess it should be there.
|
|
|
|
|
Peer-to-peer services require that each peer can see each other peer*, and each peer is capable of receiving data directly from anywhere. In TCP that means every peer must run a server; with UDP it means every peer must be globally visible for incoming connections. If you already have a chat room running on a server, I don't understand why you'd want to get into that.
Peer-to-peer is useful if your server has limited bandwidth and some of the transactions are bandwidth-saturating, if latency is critical or if you have legal concerns about the data being resident (however transiently) on your server. File sharing, the traditional home of P2P, is mostly about the first and a bit about the third. I don't see how any of them apply to a chat service.
* – at least, all the peers that are in the group you want to be able to communicate with.
|
|
|
|
|
You should save the client's socket address as a result of the EndAccept() method. you can then use that socket to communicate with the individual client. If you are dealing with multiple clients then you need to have some sort of login protocol that allows you to map a socket to a particular user. TCP/IP Chat Application Using C#[^] uses this method and should help to explain things for you.
|
|
|
|
|
The way i did was sending the user name to server and a flag with the client with which i want to communicate.
Then server send the message to that particular client on that socket.
So this looks like peer to peer but it is not. It is actually Client -to Server -to - Client.
I guess there should be some way in which we can have Peer ro Peer, may not be using TCP but something else.
|
|
|
|