Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/19/24 18:45
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, kzhao, 7th_zorro), 714 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[C++] File Executing #259123
04/04/09 03:26
04/04/09 03:26
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline OP
Expert
mpdeveloper_B  Offline OP
Expert

Joined: Feb 2006
Posts: 2,185
Ok, I am writing a Cpp launcher application, and well, as I've probably mentioned before...I'm a complete noob. As a matter of fact to be precise, I'm trying to make a splash screen for a 3DGS game I'm working on, hopefully that info is helpful. I'm using A6.60 Com. Any help would be appreciated, and I'd gladly add you to the credits.

Before Reading below keep this in mind: I can't use any MFC stuff, I'm using a free compiler.

I have two problems I would like to address:

First off:
I am executing a file and trying to monitor it's output with this line:

Code:
FILE *fp = popen("Kino.exe", "r");


but there are 2 problems.

First, the application is launched, but I see a split second popup of the command prompt...and well...frankly, I don't want that. How can I prevent this popup?

Second is that I'm not sure how to monitor if the application is closing, or changing. It is critical that I can do that. I've heard that it's easy, but well...I'm a noob.

Second Problem:

This problem has been fixed, I found a way using RAD c++ to keep the window on top perfectly.

I can post code if you want, or the full source, but I'm using Dev C++ with the RAD C++ plugin, so most of the code is written by the RAD plugin.

Edit: Second problem was fixed..

Last edited by mpdeveloper_B; 04/04/09 05:39.

- aka Manslayer101
Re: [C++] File Executing [Re: mpdeveloper_B] #259143
04/04/09 10:35
04/04/09 10:35
Joined: Jul 2008
Posts: 894
T
TechMuc Offline
User
TechMuc  Offline
User
T

Joined: Jul 2008
Posts: 894
comment in msdn:
Quote:
Note If used in a Windows program, the _popen function returns an invalid file pointer that will cause the program to hang indefinitely. _popen works properly in a Console application. To create a Windows application that redirects input and output, see Creating a Child Process with Redirected Input and Output in the Platform SDK.



to open a file use ShellExecute (http://msdn.microsoft.com/en-us/library/bb762153(VS.85).aspx). You have to include shellapi.h and bind shell32.lib

Re: [C++] File Executing [Re: TechMuc] #259167
04/04/09 14:15
04/04/09 14:15
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline OP
Expert
mpdeveloper_B  Offline OP
Expert

Joined: Feb 2006
Posts: 2,185
Thank you TechMuc. With some changes I have made I don't have to return the processes' status. I am now using:

int fp = WinExec("Kino.exe", SW_HIDE);

and the window auto closes after a few seconds. It looks really good, but I now have to work on a way to auto resize it and the image in different resolutions.


- aka Manslayer101
Re: [C++] File Executing [Re: mpdeveloper_B] #259168
04/04/09 14:17
04/04/09 14:17
Joined: Aug 2003
Posts: 7,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
Red Dwarf
About your MFC problem... why can't you use the MS Visual C++ Express edition? It's free and has no limitations to the compiler AFAIK.


"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
Re: [C++] File Executing [Re: Michael_Schwarz] #259201
04/04/09 18:56
04/04/09 18:56
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline OP
Expert
mpdeveloper_B  Offline OP
Expert

Joined: Feb 2006
Posts: 2,185
except that you can't use a project for commercial use.


- aka Manslayer101
Re: [C++] File Executing [Re: mpdeveloper_B] #259548
04/06/09 16:33
04/06/09 16:33
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline OP
Expert
mpdeveloper_B  Offline OP
Expert

Joined: Feb 2006
Posts: 2,185
Ok, most everything is working and it looks good, I just need to know how to do one thing. How can I check if a key has been pressed?


- aka Manslayer101

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1