Click here to Skip to main content
15,887,410 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
Questionhow to create a text box? Pin
bosstroy20-Nov-06 6:27
bosstroy20-Nov-06 6:27 
AnswerRe: how to create a text box? Pin
Waldermort20-Nov-06 7:00
Waldermort20-Nov-06 7:00 
AnswerRe: how to create a text box? Pin
Christian Graus20-Nov-06 14:10
protectorChristian Graus20-Nov-06 14:10 
QuestionHow to use write and read a CString var to file Pin
FRIT21620-Nov-06 5:13
FRIT21620-Nov-06 5:13 
AnswerRe: How to use write and read a CString var to file Pin
Zac Howland20-Nov-06 5:28
Zac Howland20-Nov-06 5:28 
Questionpragma once faster as an include guards? Pin
User 58261920-Nov-06 5:11
User 58261920-Nov-06 5:11 
Answer[Message Deleted] Pin
toxcct20-Nov-06 5:25
toxcct20-Nov-06 5:25 
GeneralRe: pragma once faster as an include guards? Pin
User 58261920-Nov-06 8:13
User 58261920-Nov-06 8:13 
GeneralRe: pragma once faster as an include guards? Pin
Jörgen Sigvardsson20-Nov-06 12:26
Jörgen Sigvardsson20-Nov-06 12:26 
AnswerRe: pragma once faster as an include guards? Pin
Zac Howland20-Nov-06 5:35
Zac Howland20-Nov-06 5:35 
GeneralRe: pragma once faster as an include guards? Pin
User 58261920-Nov-06 8:35
User 58261920-Nov-06 8:35 
GeneralRe: pragma once faster as an include guards? Pin
Zac Howland20-Nov-06 8:44
Zac Howland20-Nov-06 8:44 
GeneralRe: pragma once faster as an include guards? Pin
Nemanja Trifunovic20-Nov-06 10:49
Nemanja Trifunovic20-Nov-06 10:49 

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.