Click here to Skip to main content
15,892,290 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: dynamic wave creation Pin
hrishiS7-Jan-10 23:11
hrishiS7-Jan-10 23:11 
GeneralRe: dynamic wave creation Pin
Cedric Moonen7-Jan-10 23:29
Cedric Moonen7-Jan-10 23:29 
GeneralRe: dynamic wave creation Pin
hrishiS7-Jan-10 23:33
hrishiS7-Jan-10 23:33 
QuestionCalling php script from vc++ Pin
Ash_VCPP7-Jan-10 22:48
Ash_VCPP7-Jan-10 22:48 
AnswerRe: Calling php script from vc++ Pin
Code-o-mat8-Jan-10 1:21
Code-o-mat8-Jan-10 1:21 
GeneralRe: Calling php script from vc++ Pin
Ash_VCPP10-Jan-10 22:51
Ash_VCPP10-Jan-10 22:51 
GeneralRe: Calling php script from vc++ Pin
Code-o-mat11-Jan-10 1:28
Code-o-mat11-Jan-10 1:28 
QuestionProgramming with multiple entry points Pin
Dan Senior7-Jan-10 21:40
Dan Senior7-Jan-10 21:40 
Sorry if this is kind-of long... the first few lines basically contain the question, the rest clarify what I really need. Feel free to read as much as you have time for.

Does anybody know a good tutorial on programming applications with multiple entry points in C++?

I am designing an application in MSVC 2008 Express that will interface with an AS/400 system and process scripts to either feed data, extract data by reading the screen, or do custom tasks. I was planning that it could be a stand-alone program where the user loads a script and it runs, or it could be a liason between Excel and the AS/400 via COM. I was also thinking that double-clicking a file (say, on the desktop or in Windows Explorer) could add the file to the process queue, and that if the program is open I could also add a file to the queue by putting the file into a particular directory. (I think I have that part covered by the filesystemwatcher class.)

So, my questions are thus:
1. How can I design a program where if the user clicks on the icon while the program is already running, the spawned copy will recognize that the program is already running and transfer control to a particular routine in the original instance? I know it can be done because there are programs that do it. What I am asking is, in effect, how do I make it so that if the user double-clicks on an icon while the program is running, instead of opening a new instance it simply brings the user to the instance already running? (And still checks the parameters being passed in, so like if I drag a file into the icon it will be recognized?)

2. If I program a COM library of functions for Visual Basic for Applications to use to control basic tasks in the program remotely, such as querying which file is being processed or changing the priority of a particular task to be run, how do I work it so that if the program isn't running yet and Visual Basic encounters a COM command, it doesn't crash? I was thinking of making a "check if the program is open" command... which I suppose would need the program to be invoked, but only the COM portion, and return a status of if the program is running or not, then close. (Or would I want it like a TSR that would keep running in the background to handle other such events?) How would I do that?

I can see that in any case there will have to be some sort of central holding place in memory to show if the program is open or not... but if I used the registry then if the program doesn't properly shut down it will still show as being open, even after shutting down the computer and rebooting. And there would probably also have to be somewhere a pointer or handle of some sort to the original thread.

Any ideas?

Thanks.
-Dan
AnswerRe: Programming with multiple entry points - updated Pin
Garth J Lancaster7-Jan-10 21:50
professionalGarth J Lancaster7-Jan-10 21:50 
AnswerRe: Programming with multiple entry points Pin
Naveen7-Jan-10 22:07
Naveen7-Jan-10 22:07 
AnswerRe: Programming with multiple entry points Pin
Rajesh R Subramanian8-Jan-10 4:55
professionalRajesh R Subramanian8-Jan-10 4:55 
AnswerRe: Programming with multiple entry points Pin
Dan Senior8-Jan-10 11:00
Dan Senior8-Jan-10 11:00 
AnswerRe: Programming with multiple entry points Pin
Rozis8-Jan-10 11:52
Rozis8-Jan-10 11:52 
GeneralRe: Programming with multiple entry points Pin
Dan Senior8-Jan-10 14:04
Dan Senior8-Jan-10 14:04 
Questionlinking two file in gcc Pin
khomeyni7-Jan-10 21:10
khomeyni7-Jan-10 21:10 
QuestionRe: linking two file in gcc Pin
CPallini7-Jan-10 21:25
mveCPallini7-Jan-10 21:25 
AnswerRe: linking two file in gcc [modified] Pin
khomeyni7-Jan-10 21:52
khomeyni7-Jan-10 21:52 
GeneralRe: linking two file in gcc Pin
CPallini7-Jan-10 22:09
mveCPallini7-Jan-10 22:09 
GeneralRe: linking two file in gcc Pin
khomeyni8-Jan-10 2:48
khomeyni8-Jan-10 2:48 
GeneralRe: linking two file in gcc Pin
CPallini8-Jan-10 5:00
mveCPallini8-Jan-10 5:00 
GeneralRe: linking two file in gcc Pin
khomeyni8-Jan-10 5:39
khomeyni8-Jan-10 5:39 
Questionpolygon made by intersection of two polygon ??? Pin
a04.lqd7-Jan-10 20:49
a04.lqd7-Jan-10 20:49 
AnswerRe: polygon made by intersection of two polygon ??? Pin
Cedric Moonen7-Jan-10 20:56
Cedric Moonen7-Jan-10 20:56 
AnswerRe: polygon made by intersection of two polygon ??? Pin
Hamid_RT7-Jan-10 20:57
Hamid_RT7-Jan-10 20:57 
AnswerRe: polygon made by intersection of two polygon ??? Pin
Nelek7-Jan-10 21:09
protectorNelek7-Jan-10 21: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.