| View previous topic :: View next topic |
| Author |
Message |
Estx Expert Cheater
Reputation: 0
Joined: 04 Mar 2008 Posts: 172
|
Posted: Thu May 15, 2008 9:42 am Post subject: |
|
|
| Code: | Process.Start(@"c:\tasm\bin\tasm.exe", @"/zi c:\file.ext");
Process.Start(@"c:\tasm\bin\tlink.exe", @"/v c:\file.ext");
Process.Start(@"c:\tasm\bin\td.exe", @"c:\file.ext"); |
You could always set up strings to hold the information you need as well, such as the bin directory of your Turbo ASM installation or even paths to the files themselves.
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Thu May 15, 2008 11:50 am Post subject: |
|
|
i'm having trouble with last line the td.exe one cuz when it execute td it open it on the screen :S
well it actually create the .td file but after that the compiler open and the .exe file isnt created
_________________
Stylo |
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Thu May 15, 2008 12:27 pm Post subject: |
|
|
Don't do that... you're openning a CMD which calls the APIs, instead calling them directly.
You can create, read and write files using CreateFile, ReadFile and WriteFile, in C# you can simply use System.IO.File, System.IO.Directory, and System.IO.StreamReader and System.IO.StreamWriter classes.
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Thu May 15, 2008 12:58 pm Post subject: |
|
|
but i already said that my previous method for this was the system.IO
what i wanna do is openning the cmd directly from my application
_________________
Stylo |
|
| Back to top |
|
 |
Estx Expert Cheater
Reputation: 0
Joined: 04 Mar 2008 Posts: 172
|
Posted: Thu May 15, 2008 9:34 pm Post subject: |
|
|
It would've been because the previous code wasn't giving tASM enough time to do what it needs to.
| Code: | Process.Start(@"c:\tasm\bin\tasm.exe", @"/zi c:\file.ext").WaitForExit();
Process.Start(@"c:\tasm\bin\tlink.exe", @"/v c:\file.ext").WaitForExit();
Process.Start(@"c:\tasm\bin\td.exe", @"c:\file.ext").WaitForExit(); |
That will fix your problem.
| Symbol wrote: | Don't do that... you're openning a CMD which calls the APIs, instead calling them directly.
You can create, read and write files using CreateFile, ReadFile and WriteFile, in C# you can simply use System.IO.File, System.IO.Directory, and System.IO.StreamReader and System.IO.StreamWriter classes. |
It's not opening the command prompt directly, it's opening the application directly which is console based - hence the opening of the command prompt. I'm sure there are probably dynamic link libraries that tASM uses to compile the files - he could use the exports from them, but that might be beyond his current skill level in C#. I could always be wrong lol.
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Thu May 15, 2008 9:56 pm Post subject: |
|
|
still doing the same thing .. in the end of the compile i suppose to end up with 4 files
.obj file .map file . td file and .exe file , all the files besides the .exe file
and the compiler open itself on my screen :\
_________________
Stylo |
|
| Back to top |
|
 |
Estx Expert Cheater
Reputation: 0
Joined: 04 Mar 2008 Posts: 172
|
Posted: Fri May 16, 2008 9:33 am Post subject: |
|
|
| 1qaz wrote: | still doing the same thing .. in the end of the compile i suppose to end up with 4 files
.obj file .map file . td file and .exe file , all the files besides the .exe file
and the compiler open itself on my screen :\ |
What happens when you run your batch file using the exact same info as you're parsing through C#?
Once again, I will mention I don't know anything about the Turbo ASM compiler, so if you're not parsing arguments to the applications correctly then all of the help here would be for nothing.
From your previous posts, I'm guessing you're not parsing something to the "td" executable file, that will be why it's displaying itself on the screen and possibly why it is not compiling your executable.
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Fri May 16, 2008 1:59 pm Post subject: |
|
|
if you'll execute the tasm.exe and tlink.exe files you'll see the cmd on screen with the arguments you can use with them..
but if you'll execute td.exe file the compiler will open on your screen so i guess there's a diiferent between those files..
btw the .exe file is created, it's the .td file that isn't
_________________
Stylo |
|
| Back to top |
|
 |
|