Click here to Skip to main content
15,905,682 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionbackup to remote system Pin
Kiran Pinjala20-Nov-06 19:25
Kiran Pinjala20-Nov-06 19:25 
AnswerRe: backup to remote system Pin
Mila02520-Nov-06 20:12
Mila02520-Nov-06 20:12 
GeneralRe: backup to remote system Pin
Kiran Pinjala20-Nov-06 20:25
Kiran Pinjala20-Nov-06 20:25 
GeneralRe: backup to remote system Pin
Mila02520-Nov-06 20:31
Mila02520-Nov-06 20:31 
GeneralRe: backup to remote system Pin
Kiran Pinjala20-Nov-06 21:37
Kiran Pinjala20-Nov-06 21:37 
GeneralRe: backup to remote system Pin
Mila02520-Nov-06 21:44
Mila02520-Nov-06 21:44 
QuestionHow to Save bitmap data from clipboard to .bmp file. Pin
Kshitij Pande20-Nov-06 18:41
Kshitij Pande20-Nov-06 18:41 
AnswerRe: How to Save bitmap data from clipboard to .bmp file. Pin
Christian Graus20-Nov-06 20:01
protectorChristian Graus20-Nov-06 20:01 
QuestionIs it True/False Pin
Cmania20-Nov-06 18:07
Cmania20-Nov-06 18:07 
AnswerRe: Is it True/False Pin
Waldermort20-Nov-06 18:16
Waldermort20-Nov-06 18:16 
QuestionRe: Is it True/False Pin
Cmania20-Nov-06 18:23
Cmania20-Nov-06 18:23 
AnswerRe: Is it True/False Pin
Stephen Hewitt20-Nov-06 19:31
Stephen Hewitt20-Nov-06 19:31 
GeneralRe: Is it True/False Pin
Garth J Lancaster20-Nov-06 20:05
professionalGarth J Lancaster20-Nov-06 20:05 
QuestionMaking a window appear behind the icons in the Windows desktop. Pin
Inverse Man20-Nov-06 14:44
Inverse Man20-Nov-06 14:44 
AnswerRe: Making a window appear behind the icons in the Windows desktop. Pin
Michael Dunn20-Nov-06 21:33
sitebuilderMichael Dunn20-Nov-06 21:33 
Questiongetting 80070002 system cant find specified file when trying to use class Pin
malayalite20-Nov-06 14:29
malayalite20-Nov-06 14:29 
QuestionHow to start an application on another system? Pin
pavanbabut20-Nov-06 13:09
pavanbabut20-Nov-06 13:09 
AnswerRe: How to start an application on another system? Pin
Scott Holt20-Nov-06 16:30
Scott Holt20-Nov-06 16:30 
GeneralRe: How to start an application on another system? Pin
pavanbabut22-Nov-06 6:07
pavanbabut22-Nov-06 6:07 
GeneralRe: How to start an application on another system? Pin
pavanbabut28-Nov-06 8:18
pavanbabut28-Nov-06 8:18 
GeneralRe: How to start an application on another system? Pin
Scott Holt28-Nov-06 9:53
Scott Holt28-Nov-06 9:53 
OK, you can do what you suggest but it is a little different than what I was thinking. I see two basic ways to do this, both of which are perfectly reasonable:

1 - Use a COM server and client, as we have already discussed.

2 - Use a SERVICE program running on the server, which is continually listening to a specific port for incoming connections using Windows sockets.

Your statement above indicates that you are thinking in terms of the second approach.

Let me clarify the first approach a little. A COM server typically only resides in memory when a client has requested its service, and therefore has a REFERENCE to the COM server. When the client closes down, it releases the reference to the COM server, and when the COM server realizes that there are no "open" references to it, it shuts itself down. This is typical behavior in the COM world. This is OK, because with the proper registry entries on both the server and client machines, the Windows COM system will automatically locate and launch the COM server when a client requests its services. It seemed to me that your client would simply invoke the server, getting a pointer to the server's interface, then invoking an interface function that would launch a specific program on the server.

Because the Windows COM system handles launching the COM server, you don't need to worry about whether the COM server is always on and always "listening" for incoming client requests. It will get started up as soon as a client requests one of its interfaces.

Now, for approach number two...I have done this type of thing as well, using a SERVICE program, which is NOT the same thing as a COM server. Not too long ago, I wrote a service program that I set up to start every time the operating system was started. These programs show up in the "Services" program under "Administrative Utilities" in the control panel. There are a number of articles that discuss how to write a service program. In my case, my service program was designed to "listen" on a user-selectable port for incoming socket connections. When a connection was established, it would spin off a thread to process bi-directional communications between the service program and the client. This was all done using the WinSock API. In this case, the service program was always running and listening for incoming connections.

I wish I could help you more, but it seems to me you will need to first decide which of the above approaches you wish to take (or yet another approach if someone else has made any additional suggestions).

Also, please note that I don't use MFC or ATL, nor have I dabbled too much yet with C# and .net. All of my code is straight C++ with direct calls to the Windows API. So, I will be unable to help you with code snippets if you're looking for MFC or C# stuff, etc.

I need to get back to work now. I'll check back this evening.

Scott
Smile | :)












GeneralRe: How to start an application on another system? Pin
pavanbabut28-Nov-06 11:21
pavanbabut28-Nov-06 11:21 
AnswerRe: How to start an application on another system? Pin
David Crow20-Nov-06 17:37
David Crow20-Nov-06 17:37 
QuestionUsing CView Pin
BlitzPackage20-Nov-06 11:52
BlitzPackage20-Nov-06 11:52 
AnswerRe: Using CView Pin
Christian Graus20-Nov-06 14:09
protectorChristian Graus20-Nov-06 14:09 

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.