|
Thanks Luc,
However, at this time I don't need to capture stderr. My main concern is with why my capture of stdout does not capture the last line when done from C# but does work correctly when done from simple command line redirection or from a "system" function call within a C/C++ program.
Ray
|
|
|
|
|
I expect error messages to be output through stderr, so IMO you really need to capture both!
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hi Luc,
Yes, at first it would seem to make sense that error messages are output to stderr, but apparently some are not. You see, when I do a simple command line redirection of only stdout into a file, the error messages do get redirected into that file. But, if I redirect stderr only, the error messages are still displayed on the screen.
I believe the reason they do it this way is because stderr is normally used for error messages concerning problems in the application itself (the C/C++ compiler in this case). However, when the compiler encounters syntax errors in the code it is compiling, that is not an application error, so the messages concerning these errors are merely produced like a report and, thus, stdout is more appropriate. At least that's how I belive they decided upon this.
Anyway, I've got a klugey work-around to my problem of the missing last line of stdout when capture is attempted in C#. I wrote a 2nd custom application in C that looks at its argc/argv, concatenates argv[1] through argv[argc-1] together, then makes a call to the "system" library function with this concatenated string as the argument. Then in my C# program I start this custom process after initializing its arguments to be cl.exe with all the cl.exe arguments I want plus a redirection string. So, my custom process ends up being the one that actually runs the compiler and does the redirection. It's admittedly klugey but at least it works properly, whereas the version that directly starts the compiler process from C# does not. I'm sure I'm simply doing something wrong in the C# version, but as of yet I don't know what it is - and I just need to move on with my task!
Ray
|
|
|
|
|
Hi Ray,
long time ago (before .NET 2.0) I did a Process.Start() thingy with both stdout and stderr
redirected, and I ended up using two threads performing ReadLine() to read stdout/stderr
while the process was still running, mimicking a real Console operation, as opposed
to the new ReadToEnd which IMO blocks until the process is done and hence does not
correctly interleave stdout with stderr.
The only problem I had then was to get it also right on Win98, which has a completely
different kernel, and seems to be handling things quite differently.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
hi ..
for my project ... my teacher asked me to bring him a program to check english Grammar.
he said i can find the codes on the internet and use it ... as a componet or any way i like
i searched google and every place i could ... but i only can find online grammar checker or a program
not any source code ... so can any one help me about this ??
my english is not good so i dont think i can write Grammar checker bymyself ... i searched here but all i found is Spell checker ... i need Grammar checker.....
is there any componet or source code ??? my email is maboudian@gmail.com ..
ill check here also ... im counting on you guys please help me
|
|
|
|
|
I did a quick search myself and found a commercial grammar checking component that you can use in C#: WinTree Software[^]
|
|
|
|
|
Judah Himango wrote: I did a quick search myself and found a commercial grammar checking component that you can use in C#: WinTree Software[^]
hi thank you ...
but i found this site to ...
it has componets but i have to buy it .... i cant buy because i live in iran and i dont have credit cards...
( usa dont allow us to have it )
so if u got a free dll ..( componets) or soruce code please tell me
but thank you anyway
|
|
|
|
|
Have you considered looking around on sourceforge or any open source?
"Find it your bloody self - immediately!" - Dave Kreskowiak
|
|
|
|
|
Hi!
I've written a screensaver for windows using c# and it's been a smooth jounrey so far.
But when I try to run it on Vista there is a major problem.
The user can alter a bunch of settings on how the screensaver should behave using the standard "settings" button in the screensaver section of the control panel. These settings are stored in a user.config file under the user's account, I am using the the "Settings" framework in VS.NET 2005 for this which makes the whole procedure really easy to code.
The problem is that vista Launches the settings window (when the user clicks the "settings" button in the control panel) as a regular application, storing the settings in the current user's "user.config" file. However once the screensaver is actually triggered, Vista runs it in elevated mode as an administrative user, so the settings that the user specified are not actually used.
If anyone has an idea on how to work around this problem I would be very grateful. I would very much like to be able to use the auto-generated stuff in VS.NET as it makes things really simple.
Peace
/Mattias
Mattias Norlander
|
|
|
|
|
Does anyone know how to make a custom form, and by that, I mean make it the same, but look different and you have control over how it looks? I know you would first set it to have no border... but then what? Thanks in advance... -M.S.
|
|
|
|
|
MasterSharp wrote: Does anyone know how to make a custom form
No different than any other form. Not sure exactly what you are asking.
MasterSharp wrote: I know you would first set it to have no border... but then what?
Add the controls you want...
"Find it your bloody self - immediately!" - Dave Kreskowiak
|
|
|
|
|
I mean, how would you make a windows form, except, well, not WINDOWS. It would be custom, where you could put the blue bars where you want, change the form's color, or is there already a way to do that? I want to make a form that looks like on vistas.
|
|
|
|
|
If you're not on vista, you need to make the controls owner drawn, which means you write all the code to control every aspect of how they appear.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Yes. That's what I'm asking about. Does anyone know some code already that does it and is willing to share?
|
|
|
|
|
So, you want to make a custom form that looks like a vista form? Correct?
|
|
|
|
|
|
OK. I don't have any code that could help you right now, but I'm currently studying up on how to build components in .NET 2.0.
Create a new component and make it extend System.Windows.Forms.Form. After that, override the OnPaint method. That should get you started.
If you want to test your form, create a new form and edit the code by making that form extend yours. Hope this helps!
Maybe somebody else has more experience with forms? I've never created a custom form before sooooo.....
|
|
|
|
|
Based on your profile that you are VERY new programming, isn't this kind of a very big step?
"Find it your bloody self - immediately!" - Dave Kreskowiak
|
|
|
|
|
True, true, but I want to learn this so I can try a few things and play around with it, you know?
|
|
|
|
|
Sure, but like Christian said, you will have to be in control of the redrawing/painting. It is a bit involved.
"Find it your bloody self - immediately!" - Dave Kreskowiak
|
|
|
|
|
|
No, you don't. There is such a huge amount of information you don't know yet that's required to do this. Sure, we could explain it to you, but the explaination would go so far over your head that you'd think it was a jetliner.
...and it would take something on the order of about 400 forum posts to lay out.
Seriously, scale back the requirements. Skinning your first app and creating custom controls to get the look you want, is like trying to build an entire car from scratch, and you haven't even finished your first metal shop class yet.
|
|
|
|
|
Dave Kreskowiak wrote: Skinning your first app and creating custom controls to get the look you want, is like trying to build an entire car from scratch, and you haven't even finished your first metal shop class yet.
Nice analogy.
Dave Kreskowiak wrote: Seriously, scale back the requirements.
I agree.
Dave Kreskowiak wrote: ...and it would take something on the order of about 400 forum posts to lay out.
And that is on the conservative side, I reckon
"Find it your bloody self - immediately!" - Dave Kreskowiak
|
|
|
|
|
I used to read some game programming forums, and they were full of posts like:
I just started learning C++ and I'm going to write the best game engine EVER. It will have pixel shading, blah blah blah. Who wants to join my team.
Two days later:
How do you get a cube to appear in DirectX ?
Then they would be gone. So few people want to learn at a reasonable pace, it's frustrating.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Welcome to the "instant gratification" generation. An entire generation of kids who believe the world revolves around them and everything should be handed to 'em. Colleges turning out idiots and charging an awful lot of money to do so. Un-frickin-believable.
|
|
|
|