|
I doubt it. How would you define "booted okay" which I take to mean it started okay and is now doing its thing. Applications either run or don't run (services don't count for this discussion, since you don't start a service this way) and you can't tell if they ran until they are done. There is the WaitForInputIdle function for GUI apps but I don't know enough about how your emulator works to know if it exposes that amount of info about the app it is running to the outside OS.
Judy
|
|
|
|
|
I think you're looking for wait() or waitpid(). Don't know if this exists in the windows world but in general, spawn() with a NOWAIT returns the pid of the spawned process. You use waitpid to wait for the exit status. Using a NOHANG flag with waitpid prevents blocking. Either poll with a waitpid or perhaps kick off another thread that does a wait.
No doubt there is a more windowzee way of doing this.
|
|
|
|
|
Manasi D wrote: How to Run UNIX based EXE [MKS] through Shell in VC++ application.
You mean - you want to run a native unix file under windows? And that's urgent?
That's impossible, my friend.
And who is voting me down on a programming forum for no good reason?!
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
modified on Friday, May 9, 2008 11:42 AM
|
|
|
|
|
bro, please delete your last sentence, which sends oil on fire for nothing. i've counter-voted that post BTW.
|
|
|
|
|
Thanks for the vote Tox.
You take time to come and participate in the discussions and someone votes you low without any valid reason. I know you too would have had this experience. It just is plainly annoying.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Dont' worry (be happy) your score is raising.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
It was me.
[Rude/inflammatory content removed by poster]
modified on Friday, May 9, 2008 12:56 PM
|
|
|
|
|
enhzflep wrote: It was me.
May I please know the reason behind you down-voting my answer?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Certainly, of course it will make me look more of a fool, but such is life...
Um, when I gave that undeserved vote, It was after I had read the second post by Manasi D in this thread. The one where the fact that an emulator was being used was stated.
When I look at the forum this instant, I see that the post you made that I down-voted was made 1 hr 57 mins ago.
The post that clarified that an emulator was used was made 1 hr 38 mins ago.
I did not even think to look at these times when I handed you the 1.
Obviously, your post was made some 19 minutes before the clarification was made.
So again, I accept the label of idiot .
Sorry for the upset I've caused.
Simon.
|
|
|
|
|
enhzflep wrote: When I look at the forum this instant, I see that the post you made that I down-voted was made 1 hr 57 mins ago.
The post that clarified that an emulator was used was made 1 hr 38 mins ago.
That sums it up. Sorry for calling you an idiot and thanks for taking the time to explain.
[Shameless] After the upgradation of CP, You can re-vote on any post, just in case, FYI. [/Shameless]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rajesh R Subramanian wrote: Sorry for calling you an idiot and thanks for taking the time to explain. [Smile]
[Shameless] After the upgradation of CP, You can re-vote on any post, just in case, FYI. [Red faced] [/Shameless]
Don't worry about it. I was(am?) an idiot, I just reject spineless .
Post re-voted.(5)
seeya!
|
|
|
|
|
Manasi D wrote: How to Run UNIX based EXE [MKS] through Shell in VC++ application
not sure, but wouldn't having a cygwin help ?
otherwise, i'm not sure at all this can be done...
|
|
|
|
|
Cygwin is just an emulator. The OP wants to run a UNIX binary under a windows machine. Cygwin (or nothing else) can run a native UNIX app on Windows. Talk about doing the impossible.
And that is an urgent query, if you haven't noticed it yet.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rajesh R Subramanian wrote: Cygwin (or nothing else) can run a native UNIX app on Windows. Talk about doing the impossible.
For the record I am not the guy who voted you down.
But I wanted to say that you are absolutely incorrect. Compilers simply generate machine code and Unix/Linux ELF binaries are nothing more than a file format. The instructions inside are still x86 instructions. I have done many experiments executing simple ELF binaries on Windows as have many others before me. For simple commandline/shell ELF binaries all you need to do is implement some of the missing libc and/or ncurses functions. It certainly becomes more difficult when the complexity of the ELF is increased. For example non-static ELF binaries which are loading many shared objects can be extremely difficult to load in Windows.
At any rate I just wanted to point out that you should never say something is impossible. There are many talented researchers who read this forum who just might do the impossible.
Best Wishes,
-David Delaune
|
|
|
|
|
Randor wrote: The instructions inside are still x86 instructions. I have done many experiments executing simple ELF binaries on Windows as have many others before me. For simple commandline/shell ELF binaries all you need to do is implement some of the missing libc and/or ncurses functions. It certainly becomes more difficult when the complexity of the ELF is increased.
Believe me or not, I hesitated a moment to choose between "impossible" and "next to impossible". Because I've heard this hack, only from an old professor of mine. While you say that you've experimented on similar stuff, I can guess your age and experience. So, my respect for you has gone up by two notches. And thanks for the inputs; that's a lot interesting. I'll probably read up on that in free time.
[ADD]And needless to say, I know that you won't be the one down-voting. [/ADD]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
modified on Friday, May 9, 2008 11:30 AM
|
|
|
|
|
I agree with you i know wine [^]on linux runs native win32 code even directX code. Rajesh knows i won't vote down.
|
|
|
|
|
Rajkumar R wrote: I agree with you i know wine [^]on linux runs native win32 code
I was wondering about the converse part of it. Running UNIX code - rather UNIX binaries on Windows.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I mean the possiblility. that David was discussing although reverse.
|
|
|
|
|
That should be fantastic man. What do you think? I'm going to give that a little try at my free time.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
you should. good luck.
Now there are tools like linux virtual machines running on windows that can do run native codes, some colleagues use it.
|
|
|
|
|
Just as WINE runs windows execs in linux, LINE runs linux execs in windows.
There's also lina, but that requires sources be recompiled (changing what, I can only guess)
|
|
|
|
|
That must make a fantastic read. My Sunday will be spent on this, I'm afraid.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Manasi D wrote: Int lnSts =_spawnl(_P_NOWAIT,"SHELL.exe","SHELL.exe","-Lc Target.EXE",NULL);
If you are wanting something a little more modern that _spawnl() , see here.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I have an MFC application whose onok and onkcancel method have been disable. Also I have overidden the esc and return keystroked. This MFC application calls another application B thru a createprocess method and aits via WaitForSingleObject until this application B quits. At this point I would like to quit my application. How do I self destroy my dialog. Please provide the exact API call. I used postmessage without luck.
|
|
|
|
|
Try EndDialog(0);
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|