I am hoping someone can help me by pointing in the right direction with a problem I have
I want to be able to create appointments using Outlook\Exchange server and sync those to my device using pocket outlook. On the device I want to be able to open the appointments application on the device, clicking on a menu option and pass the appointment details to another application (which I am writing also).
Any ideas? How easy is this to do and where is the best place to start looking for working how to pass data between outlook and my application? I've read the POOM section on msdn and think I can do the menu option but dont know the best way to tackle the integration. The Other application is written in C#.
Thanks
Morris
This sounds like you are asking more about inter-process communication between your pocket outlook plugin and your 'other' app. Given that you should be able to get the id of the appointment from the outlook plugin/menu item etc. then you can use a number of methods to pass that id to your other app, and then have it open the appointments collection and find the right appointment via POOM.
This could be as simple as sending your other app a windows message with the id as the LPARAM and use a messagewindow in your other app to receive the message. (Not sure if the id will fit in LPARAM though, WM_COPYDATA could be an alternative), however this approach needs some handshaking at the start to pass the window handles to each other.
You could use P2P (Point to point) message queues between the two processes, or tcp/ip sockets.
One other way could be for the pocket outlook plugin to mark the appointments with a custom property, and then just use a named event to signal to the other app to do it's thing, and it could find all the marked appointments via POOM and process them.
Related
I am new to .NET and seeking help for the Windows Service Updates Notifications.
I have a use case that is somewhat similar to "https://stackoverflow.com/questions/41232170/c-sharp-show-notification-prompting-a-update".
The application is developed in C#.NET and is deployed and running as Windows Service.
However, the application is not using any MSI installer to install it. I am using a batch script that configures the Windows Service application.
Now, I want to show the notifications about the updates about the Windows Service to the user, when the system gets restarted.
I came across about the usage of WCF or by using the Task Scheduler, but not sure which one would be the better solution.
Please advice.
Ok, there are (were, because MS disabled the first one that I'm going to explain) two ways to notify your user about updates from a service.
First, the bad, ugly (and non-working in recent versions) way: interactive services.
You can configure a service as interactive, if you add the SERVICE_INTERACTIVE_PROCESS flag the service will be able to create a GUI that will be attached to Display_0. This presents a ton of problems (trying to show a GUI when there's no user session, if you have two sessions open only the first one will show the GUI and so on) but it's a cheap dirty way to show data to the user. Avoid it.
Second, the right way: a standalone GUI program.
In this case you create a secondary program that will show the data to the user, you can start it with the user session or let the user decide if he wants to receive info by opening manually this application. This program needs to receive the updates from the service in some way, which is better is up to you but I would use UDP for this, in this way your service doesn't needs to care if any GUI app is connected or not, you broadcast an UDP message and everyone listening will receive it, you don't need to mantain a server that handles connections, you don't need to have an storage in order to maintain the event data and it will support any number of instances of the GUI (if more than one user has started a session in the machine all of them will get notified).
But as I said, that would be my preference, you can do it as fancy as you want, you can use Pipes, use a file that contains the event and use a FileSystemWatcher to get notified when changes happen in it, you can even host an ASP .net web app which implements a SignalR hub and then you can create your GUI in html. It's up to you decide which mechanism is the best for your scenario.
I'm trying to implement my C# backend's communication with Notification Hub. I've read almost every tutorial about Azure Notification Hub, and I can't find a decent tutorial that explains what actually corresponds to what. I think there are two ways of representing a device (from what I've understood): an Installation and Registration, and Installation seems to be newer and more preferred.
However, when I get into Installation, I get more questions in my mind:
What is InstallationId? Is it something that I create, or something that I get from somewhere, either device or PNS.
Do I need to set up ExpirationTime, or does it default to longest (it says 90 days is the longest)? What if I want it to be longer than 90 days?
What is PushChannel? Is it, just like InstallationId, something that I create, or get from somewhere?
How are templates exactly used?
Out of all these variables, which one is the actual device push token that I get at the client?
I usually don't ask those kind of questions that seek for a tutorial-ish answers and have multiple questions, but I've tried to search everywhere, but the more I search, the more it gets complicated and I don't even know where to start. Any answer would be a good starting point to anyone trying to learn Notification Hubs, just like me.
InstallationId is an abstraction on top of device token/key/channel etc. It's a unique id that you create when you 'install' a device (or user if your OS/platform allows separate tokens for multiple users). This is an id you can use to associate tags, templates etc with the device. You create an installation once and then keep the id somewhere in the local storage and then make updates to the installation associated with the id if you need to.
You don't need to explicitly set ExpirationDate. I think in the past tokens on most platforms used to expire, so this was a way to let Notification Hubs know when not to try to push to the token. I believe now it's not the case. So what happens is if Notification Hubs cannot deliver a notification to a device for a number of times, it just deletes the registration by itself.
Has this post on templates been useful?
PushChannel stands for 'The channel URI if registering the installation for WNS; Device Token if registering for APNS.'
Let me know in the comments if I can clarify any of these and I'll update the answer.
There is actually a 3rd option besides Installation and Notification: DirectSend.
The Direct-Send technique is less of an abstraction than Installation and Notification. With Direct-Send you can send notifications directly to one or more specific devices. Basically you use the actual deviceToken- as in what #NikitaG notes for PushChannel.
If you need to be able to decide specifically when your back-end application pushes to a specific-device-A-but-not-B vs. pushing to a specific-device-B-but-not-A vs. specific-device-A-and-specific-device-B according to some schedule Direct-Send can be enabling.
I'd listed some of the resources discussing Direct-Send at Azure Notification Hubs Send Notification to Specific Device.
Im looking for some advice on an application im creating using a windows service. Basically we have some timesheet software and i need to create a windows service that will poll a db to see if they have completed last weeks timesheet. If they havent completed it i want the application to popup a message stating that it is incomplete and that they should go and complete it.
Ive created a simple service from a tutorial i found and got it to install and run fine. I now need to think about the form side that popups up. Thing is im not sure its a good idea to do this from a service. Can anyone give me a steer on the best way to develop this application using a windows service.
as mentioned earlier you may not create userinterfaces from within Services. In order to achieve this. you have to build another application. you can use Windows Forms or WPF for building the NotificationArea inteagration application.
I would use WCF with net tcp binding to communicate between both applications.
Well as you aslmost said your self. This is not well suited for a windows service since there is nothing going on when a user is not logged in. If on the other hand you were also sending mails AND showing pop up a duel approach would be ideel.
I recommend scrapping the service and only use your form.
You could develop ANOTHER WinForms application that reads from a Database (for example) every X seconds
Your Windows Service will write to the Database indicating whether the job is done or not.
once your Winforms application (that can sit in the system tray for example) reads from the database and sees the job is not done - make it pop up and alert the user.
Just a thought!
Is there an easy way to send group chat messages to Skype from .NET? I don't need to respond to any commands or anything, so it doesn't need to be a BOT. Basically, I would run this program on a dedicated box with Skype running as a special user and I would have it report certain information to a specific group chat.
I understand there is a Skype COM library. I have seen examples based on that but I haven't been able to get any traction.
The currently available Skype API for Windows uses WM_COPYDATA to exchange text-based commands for controlling Skype (see the Public API Reference download). There is a new thing called SkypeKit in development but it's a closed beta so I don't know what it will do to enhance the experience.
There appear to have been a few projects here and there that have wrapped the existing public API with some .NET-based calls using C#. These either wrap the basic level messaging system or the COM wrapper, Skype4COM (as you have already seen). A Google search gave me these results that seem to get you started:
Controlling Skype with C#
How to do Skype in C#
C# Example Project for Skype4COM
Based on your experiences, I would look at the first item in this list as it appears to be a directly interacting with the Windows messages (i.e. WM_COPYDATA) rather than Skype4COM.
Sending a chat message to a group
Assuming you utilise the C# wrappers referenced above, here is a rough idea of the commands you'll need from the public API in order to send a chat message to a group.
The command to start a chat is CHAT CREATE. It appears from the documentation that you have to specify each recipient (or target, as the written in the API reference) individually. Whether this can be a group name or not is not made clear, however, the GET GROUP USERS command enables you to obtain the individual users within a specific group.
Once you have a chat, you can use the CHATMESSAGE command to actually post a message.
I write system, that collects informations about local system. It's a system like admin-client. Client collects and sends log to admin. There's of course possibility to get this log by admin over LAN, but I'd like to add option send log over Internet.
I thought about skype. Client must have logged skype and when admin (of course there must be appropriate authorization, but it's separate topic) send request by skype - client must e.g. connect to SQL database or simple file with collected log and send it over skype.
How can I do this?
Is this the best way? Plugin in skype? What lib may I use?
I think it's an either/or situation.
If you want an administrator who is already using Skype to be able to send this information over the internet, then a plugin which exposes that functionality in Skype is the way to go.
If you want the administrator to be able to send the information over Skype's network, but not necessarily have to have the application running (perhaps this will be done through the application that gathers data), then using the API to control Skype externally is better.
You can find the documentation for Skype here:
http://developer.skype.com/accessories
Skype has a COM API called Skype4COM which you could use through COM interop in order to access Skype.
It should be noted that SkypeKit is now available for use in both embedded and desktop programs. There's a small one-time registration fee (currently $5 USD) for each program, but it will allow you to access Skype without actually using any UI functionality (it's completely up to you to provide the interface).
Until SkypeKit is released, you're limited to the Skype Public API. However according to the docs this API only allows to specify the recipient and open the file dialog, initiating a file transfer automatically seems to be impossible (see "OPEN FILETRANSFER" in the docs).
I suggest you use an open protocol like HTTP or FTP instead.