I'm planning on making my existing application into an RTD server.
The application is currently written in C++ and while I will eventually port it to C#/Mono I want to be able to add the RTD functionality with C++.
I have found a few sample pieces of code (the MSVCRTDServer) and this site: http://weblogs.asp.net/kennykerr/archive/2008/10/29/excel-rtd-server-in-c.aspx
Unfortunately these are DLLs and I have forgotten all I knew of COM (good riddance) a long time ago.
How do i go about incorporating the DLL examples into the EXE? This is apparently about packaging the COM server in an EXE rather than a DLL.
EDIT:
Note, the existing app has an MFC GUI.
EDIT:
The intended use is taht the existing GUI app will be running - no need for clients of the COM/RTD interface to launch the app. (Although I won't deny that would be nice)
Basically i want to implement the IRTDServer interface with my own data - so that Excel (or other apps) can access the dynamic data that the application provides. (It is a program that talks to a serial port device - that device has status/state that changes and i want to be able to update clients on the changes asynchronously)
So, I need to create a COM object and register it so that clients can "see" it.
I am not sure how to add a COM object to an exe and have that COM object implement an existing/pre-definfed interface.
EDIT I started a bounty on this so I could get code samples. Apparently I am too lazy and stupid (or maybe it is just the hyper aversion to COM) to get started with existing answer by Franci Penov. (which is very useful and a great start)
So basically what I am looking for is:
code to take my existing dialog based MFC application that has a bunch of threads running and turn it into an RTD server (that has the same UI)
All that cocreate and CoThisandthat, etc. Where do I put that code in my exe? How do I extend/implement the IRTD stuff?
A before and after of a sample MFC hello world app (dialog based) is going to get the accepted answer.
- Before app with all the source code for mfc dialog app.
- "after" app that is based on the MFC app in step #1 that implements the RTD srver interface and all of its source. (all project files, source, etc)
- steps taken in the GUI/visual studio and otherwise to create step 2 from step 1. ( IDL, etc other files created. )
Ideally this is provided for VS2008, but any version would work.
Thanks.