Author Topic: ShellExecute problem  (Read 5536 times)

0 Members and 1 Guest are viewing this topic.

Aurel

  • Guest
Re: ShellExecute problem
« Reply #15 on: April 08, 2013, 01:37:21 AM »
Frank..
You again miss this:
Code: [Select]
STRING fName
char tx[500000]
string gxName="\gxo2.exe"
char cdPath[256]
GetCurrentDir 256,cdPath
cdPath = cdPath + gxName

Your editor must know where is gxo2 compiler -> full path like D:\oxyfolder\gxo2.exe
And there is no alternative way with ShellExecute need full paths for compiler and for file.
This not nothing about open&save...i hope you get it now  ;)

good thing will be to add to editor option which will save compiler path into one small file .
then every time you start editor know where is gxo2 compiler is ,right?

Charles Pegge

  • Guest
Re: ShellExecute problem
« Reply #16 on: April 08, 2013, 09:38:27 AM »
Quote
there must be an alternative way to work with "shellexecute" and "gxo2.exe" for compiling/running the script example without saving of open the current file.

To answer your last question, Frank, it is necessary to run gxo2/Oxygen as a separate process from the IDE, if you want to execute the program immediately (without creating an exe/dll file).

Otherwise, you can safely use Oxygen directly from the IDE to create exe and dll files. You can then pass source code strings directly to Oxygen.

 But you will, of course, still need to launch them from the IDE with ShellExecute or CreaterProcess

Charles

Frankolinox

  • Guest
Re: ShellExecute problem
« Reply #17 on: April 10, 2013, 01:56:26 AM »
thank you aurel, thanks charles for feedback and tipp :-)

"shellExecute": after some experiments I've got this for running without saving/loading file and this line is working for me for executing. I am very glad that this one works for me.

Code: [Select]
' doCompile() sector
''ShellExecute(0,"open", "/gxo2.exe","-c" + fName,"" , 5)

ShellExecute(0,"open", "/gxo2.exe","" + fName,"" , 5) ' execute the oxy code example without saving or loading like "execute" function ;)

'ShellExecute(0,"open", "/gxo2.exe","" + fName,"" , 1) ' for aurel: both ways with "5" or "1" are working ;)
 
@aurel: in your interesting AsciEditor you must first a) "compile" the code and then you can b) execute (dorun() with "shellexecute" function ) the code example. without compiling before you cannot run (dorun) your code and that was confusing me some days ago. but I've found a very good solution for me with above code line.

new edit: last minutes ;)

best regards, frank
« Last Edit: April 10, 2013, 02:20:34 AM by Frankolinox »

Aurel

  • Guest
Re: ShellExecute problem
« Reply #18 on: April 10, 2013, 02:09:32 AM »
Hi frank
It is normal that when you use compiler
1.compile
2.run (execute compiled program)
You must only first time compile program ,right?
and i don't see anything wrong with that .
Editor each time autosave opened file because if you made some changes in code
this changed code will be saved and compiled.
this is very clear

Ok i see that you use option without parameter '-c' as empty parameter
so on that way is program executed right now,right?

This option can be added without a problem in AsciEdit i think...
(i see that you also use as last parameter 5)... ;)

When i catch some time i will add tabs to, it is already in awinh.inc.
If you whish you can try tab controls and see how works... :)

Frankolinox

  • Guest
Re: ShellExecute problem
« Reply #19 on: April 10, 2013, 02:25:32 AM »
ok aurel. but for an "sciEditorTab's" you can go with "mdi" + "tabs" and that's not very easy I can remember from powerbasic and my editor, that's a job for next week to convert this one to oxygen. time is missing here at the moment for further wokring. tab's aren't here the problem but the connection to mdi and tabs and files. so we will get very near and close to professional sciEditor I can imagine ;)

frank

Aurel

  • Guest
Re: ShellExecute problem
« Reply #20 on: April 10, 2013, 04:53:33 AM »
Frank..
I don't have in plan to waste my time on MDI interface,why ...
simply because i don't see any advantage of using mdi over SDI.
Do you see oxyEdit written in EBasic...?
simple sci control and tab controls and that is ,and work fine  ;)really i don't see
why anyone need MDI..
and many great editors around use just SDI..