Problem: outputting compiler info
-
- Posts: 148
- Joined: Mon Sep 05, 2005 10:25 am
Problem: outputting compiler info
While I was following some advice given to me (I don't exactly remember who told me to do it), I came across a problem. What I'm trying to do here is create output text that is written to a textbox when an action has been done within the program. For example, when the user presses the compile button on one of my two functional compilers, I want to be able to display the output text from Tool.exe in the textbox. The compiler window is an MDI form, the textbox for logging is not (it's contained in a pannel that's part of a toolset called Dock Manager).
below is an image of how my program looks like:
This program is written in C#. How would i go about fixing my problem.
below is an image of how my program looks like:
This program is written in C#. How would i go about fixing my problem.
- grimdoomer
- Posts: 1440
- Joined: Mon Oct 09, 2006 4:36 pm
In the click procedure add this:
Code: Select all
textbox1.Text += "\nText Here";
AI Zones in MP | Ambiance | Gravemind Beta v1.1
Aumaan Anubis wrote:Grimdoomer. The first person ever to mod Halo 2 Vista.
-
- Posts: 5426
- Joined: Sat Jul 24, 2004 12:12 pm
- Location: I'm a Paranoid
- Contact:
Deleting this post cause Korn said so
Last edited by Patrickssj6 on Wed Apr 02, 2008 6:25 am, edited 1 time in total.
uhm, no...Patrickssj6 wrote:For strings useCode: Select all
&= instead of +=
And he states he is using C#. Stop trying to spread virii.
-
- Posts: 5426
- Joined: Sat Jul 24, 2004 12:12 pm
- Location: I'm a Paranoid
- Contact:
-
- Posts: 148
- Joined: Mon Sep 05, 2005 10:25 am
more clarity
ok maybe i wasn't clear enough in my first post. The text box is in the MDI parent form and is contained within a docking tool i got off of the internet. what i tried to do was this:
Main.cs (form)
Compiler.cs (child form)
when i run the code in debug mode, VS throws an exception. i'm coding in VS 2008 Pro if that helps any.
i hope that helps you answer the question a little easier.
Main.cs (form)
Code: Select all
//using statements
//constructor
private string editLog="";
public string outputText
{
get
{
editLog += logBox.Text;
return editLog;
}
set
{ editlog=value; }
}
//rest of code
Code: Select all
//using statements
//constructor
main logger=main();
//event handler
private void compilerBtn_Click(object sender, EventArgs e)
{
//compiler code
//get output message to output textbox
logger.outputText += (DateTime.Now+" output message "+copileDir.Text+".");
}
//rest of code
i hope that helps you answer the question a little easier.
-
- Posts: 148
- Joined: Mon Sep 05, 2005 10:25 am
oh right sorry i'll get that up right away.xbox7887 wrote:Care to post the exception message with stack trace?
I didn't see any call stack noticesVisual Studio Exception wrote:Win32 Exception Was Unhandled
Error creating window handle.Code: Select all
this.groupbox5.controls.add(this.collisionCompile);
and the code that appeared in the exception had nothing to do with what the logging that i was trying to do. there was no message attached to the that button.
The funny thing is that an insertion like what i've attempted to do works with the parent form->child form, but not the other way around.
similar code from script template editor:
Code: Select all
//event handler code
private void button1_Click(object sender, EventArgs e)
{
//instantate the form
childform aform = new childform();
//set the mdi parent
aform.mdiparent = this;
//create the output text
aform.editText+="script text";
//show the form
aform.show()
}
-
- Posts: 1262
- Joined: Sun Sep 03, 2006 10:43 pm
- Location: Michigan
-
- Posts: 148
- Joined: Mon Sep 05, 2005 10:25 am
Ok i confirmed it, the problem is not in the code i made in an attempt to transfer the message over to the output textbox. However, the text will not write to the output textbox. Since my code practice (according to kornman00) isn't that great (and i value that crit) are there any suggestions to improve my code? and what can i do to fix this problem?