Problem: outputting compiler info

Post here about scripting and programming for HaloPC (audio, network, ai, etc.)
Post Reply
demonmaster3k





Posts: 148
Joined: Mon Sep 05, 2005 10:25 am

Problem: outputting compiler info

Post by demonmaster3k »

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:

Image

This program is written in C#. How would i go about fixing my problem.
User avatar
grimdoomer




System Engineer

Posts: 1440
Joined: Mon Oct 09, 2006 4:36 pm

Post by grimdoomer »

In the click procedure add this:

Code: Select all

textbox1.Text += "\nText Here";
Image
AI Zones in MP | Ambiance | Gravemind Beta v1.1
Aumaan Anubis wrote:Grimdoomer. The first person ever to mod Halo 2 Vista.
Patrickssj6




Pi Collaborator

Posts: 5426
Joined: Sat Jul 24, 2004 12:12 pm
Location: I'm a Paranoid
Contact:

Post by Patrickssj6 »

Deleting this post cause Korn said so
Last edited by Patrickssj6 on Wed Apr 02, 2008 6:25 am, edited 1 time in total.
User avatar
kornman00




ONI New Age

Posts: 146
Joined: Fri Dec 12, 2003 6:30 pm
Contact:

Post by kornman00 »

Patrickssj6 wrote:For strings use

Code: Select all

&= instead of +=
uhm, no...

And he states he is using C#. Stop trying to spread virii.
Patrickssj6




Pi Collaborator

Posts: 5426
Joined: Sat Jul 24, 2004 12:12 pm
Location: I'm a Paranoid
Contact:

Post by Patrickssj6 »

>.>
User avatar
kornman00




ONI New Age

Posts: 146
Joined: Fri Dec 12, 2003 6:30 pm
Contact:

Post by kornman00 »

<.<
demonmaster3k





Posts: 148
Joined: Mon Sep 05, 2005 10:25 am

more clarity

Post by demonmaster3k »

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)

Code: Select all

//using statements

//constructor

private string editLog="";
public string outputText
{
get
{
editLog += logBox.Text;
return editLog;
}
set
{ editlog=value; }
}
//rest of code
Compiler.cs (child form)

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
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.
User avatar
xbox7887




Socialist Coagulator Decryptor Advisor
Eureka Commentator Wave Scorched Earth

Posts: 2160
Joined: Mon Dec 27, 2004 6:19 pm
Location: New Lenox, Illinois
Contact:

Post by xbox7887 »

Care to post the exception message with stack trace? :?
demonmaster3k





Posts: 148
Joined: Mon Sep 05, 2005 10:25 am

Post by demonmaster3k »

xbox7887 wrote:Care to post the exception message with stack trace? :?
oh right sorry i'll get that up right away.
Visual Studio Exception wrote:Win32 Exception Was Unhandled
Error creating window handle.

Code: Select all

this.groupbox5.controls.add(this.collisionCompile);
I didn't see any call stack notices

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()
}
the above works no problem (but what i tried to do was vitureally the same thing in reverse, but it won't work)
User avatar
kornman00




ONI New Age

Posts: 146
Joined: Fri Dec 12, 2003 6:30 pm
Contact:

Post by kornman00 »

Ever think that the exception is being caused by something else besides from the code of what you're trying to do?...

There are far too little details to really debug your problem, especially over a thread...

And your coding standards make me want to cry :cry: (no offense).
Supermodder911




Connoisseur Coroner

Posts: 1262
Joined: Sun Sep 03, 2006 10:43 pm
Location: Michigan

Post by Supermodder911 »

kornman00 wrote: And your coding standards make me want to cry :cry: (no offense).
I must agree.
Image
C Wizzle
demonmaster3k





Posts: 148
Joined: Mon Sep 05, 2005 10:25 am

Post by demonmaster3k »

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?
Post Reply