Page 1 of 1

How to open exe from within irrlicht?

Posted: Sun Aug 28, 2005 3:57 am
by MikeR
I have a button: Open that I would like to open another program from within an irrlicht app. I have been searching the web, but can't figure out how to code it.

Code: Select all

class MyEventReceiver : public IEventReceiver{public:	virtual bool OnEvent(SEvent event)	{		if (event.EventType == EET_GUI_EVENT)		{			s32 id = event.GUIEvent.Caller->getID();			IGUIEnvironment* env = device->getGUIEnvironment();
            switch(event.GUIEvent.EventType)
            {
case EGET_BUTTON_CLICKED:
              if (id == 101)
              {
                 device->OpenDevice(myOtherApp.exe);
                 return true;
              }
(code is example only)
Would this code work? or is there another way?

Posted: Sun Aug 28, 2005 4:20 am
by Guest
spawnlp

Posted: Sun Aug 28, 2005 9:15 am
by Didine
system("your_app.exe");

Posted: Sun Aug 28, 2005 9:58 am
by WToma
I think it is very system specific. Under windows, see ShellExecuce and ShellExecuceEx API functions.
Toma

Posted: Sun Aug 28, 2005 3:00 pm
by MikeR
I added: system("myApp.exe"); and it compiles fine, but won't open.
I may have to go a different route.
(the exe is where it's supposed to be.)

Fixed and working. I was linking wrong. system("folder\\myApp.exe"); works great.