|
i dont want to change my application to a console app because i dont want the console showing up whenever i run my application.
BUT..
i needed to have some commandline options to the application..
ex: my_app -e somefile.txt
i would now need to write to the console any error messages i would encouter.
is there a way to output to the console
like using Console.writeln("message"); when my application is a windows application?
thanks..
-- kaloy --
|
|
|
|
|
If you're not in a console application, and you're debugging, it'll forward to the debug output window. If you want to forward to some sort of stream (say a text file or network connection), you could use Console.SetOut. If you want the errors to display in a text box or something, the only method I've discovered so far is to make your own version of TextWriter that overrides the Write and WriteLine functions (there's a lot of them -- just do the ones you need), and Console.SetOut to that.
Actually, it might be interesting to make an article about this.
|
|
|
|
|
thanks..
but is there a way to display the messages on the same console that called the application?..
i dont need to forward it to other streams..
maybe i'll just have to save it to a file if i could NOT find a way to display it.
thanks anyway..
-- kaloy --
|
|
|
|
|
Sorry, I don't think I really understood what you're trying to do.
So you have a console application which calls a windowed application, and you want the Console.WriteLine calls from the windowed application to show up in the original console application?
|
|
|
|
|
sorry about the confusion..
i have a windows application. when i open the application from a command prompt (or a console). i need to display the error messages to the console.
the current behavior is no messages are displayed.
hope this clears things up
thanks for your time..
-- kaloy --
|
|
|
|
|
Compile this as a console program, call it "dump.exe" maybe.
<br />
using System;<br />
using System.IO;<br />
<br />
namespace Dump<br />
{<br />
class Class1<br />
{<br />
[STAThread]<br />
static void Main(string[] args)<br />
{<br />
char[] buffer = new char[512];<br />
int len;<br />
while((len = Console.In.Read(buffer, 0, 512)) != 0)<br />
Console.Write(buffer, 0, len);<br />
}<br />
}<br />
}<br />
<br />
When you call your program from the console, call it up like this: my_app -e somefile.txt | dump . This pipes the console output to dump.exe, which in turn displays it to the console.
Or, rather than using that dump program, you can use more like this: my_app -e somefile.txt | more . The problem with this, though, is that it stops and waits for you to hit a key once it fills up the buffer.
If you just want to dump the Console output to a file, you can say my_app.exe -e somefile.txt > consoleoutput.txt .
|
|
|
|
|
Has anyone seen the following error, using WSE 2.0 :
Microsoft.Web.Services2.Security.SecurityFault: An error was discovered processing the <security> header ---> System.ArguementOutOfRangeException: Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.
Then a call stack.
Attempting to use WSE 2.0 to login into my webservice using Kerberos Tokens. I only get this error when logging into the webservice if the webservice is on the local machine. If its on another machine, it seems to work ok.
Cheers,
"If you're too careful, your whole life can become a f---in' grind." - Mike McD (Rounders)
|
|
|
|
|
Hi,
Im beginner in direct3d programming.after I had installed directx 9.0 sdk,tried to write code using the methods of the IDirect3D9 interface. but IDE(Visual Studio 7)doesn't show list members by reference pointer to the interface .
please let me know how to ensure that.
Thanks
|
|
|
|
|
Hi, I had solved my problem.
Goto directoty \\Windows\Assembly\GAC then copy all file dll of Microsoft.DirectX into :\\Microsoft Visual Studio .NET 2003\Common7\IDE\PublicAssemblies
Thanks!
|
|
|
|
|
I have a windows installer (deployment project) as part of my VB.net solution. It is set up to remove previous versions prior to being installed. As part of the installation process, several configuration files are installed onto the machine along with the application.
I would like to set it up so that when the application is installed, it creates the configuration file if none exists, but leaves the file otherwise. I would also like to be able to flag in some instances that the file should overwrite regardless of whether the file exists or not.
Any pointers on how I can set this up in the deployment project, as I have not found a good source of information regarding it.
Thanks for the feedback,
sc
|
|
|
|
|
Sorry, there is no easy answer to this question. Forcing overwrites is easy - set the version of a file in a new install higher than previous versions, and it will always be installed.
Conditional install is much trickier and depends on Version, Date, and Language. Rules for non-versioned files are different.
The VS Installer provides a very limited interface. You will probably have to modify the msi database manually to accomplish what you need.
You can download the full Windows Installer documentation, along with tools that allow you to edit msi packages from MS:
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/default.htm?p=/msdownload/platformsdk/sdkupdate/SDKInfo.htm[^]
Editing msi table is not for the faint of heart. You can find a free e-book here:
http://www.larkware.com/InstallerBook.zip
You can also find forums and resources at:
http://www.installsite.org/[^]
Unless you really want to become an expert on Windows Installer technology, I suggest you farm it out to someone who already is.
|
|
|
|
|
Thanks for the feedback and info.
I was kind of afraid it was going to be as you describe it, but was hoping I had missed something simple. Apparently not. I'll look through the sites and try to guage what it will be like, but as this is a "nice to have but non-essential" item, I'll probably just give it a pass.
Thanks again.
|
|
|
|
|
Hi!
I've several client applications which call methods of singlecall objects on the same server. Now my question is wether the server processes requests which come at the same time parallel (implicit by multithreading) or serial?
Thanks in advance!
|
|
|
|
|
The remoting framework takes care of synchronization for you. You don't have to write any synchronization code. Each client will get it's own singlecall object.
Regards
Senthil
My Blog
|
|
|
|
|
Is polling really the only way to get information about a clients connection status. I am work on an application where more the one client is connected to my server app. and I need a notification when a client disconnects. Can anyone help me?
|
|
|
|
|
Is there anything out there that allows .net applications to run without the need for the huge .net framework to be installed?
I know about salamander linker and thinstall, but are there other tools or ways to do that?
|
|
|
|
|
nope.
Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg
|
|
|
|
|
I've heared that it's easily possible to view IL code of a compiled application. How is it possible ? Obviously, you don't need to decompile or disassemble it, as it's already IL code, but just in byte-code, right ? So how can you get it back to text mode, so that you could actually view the IL code (in a text editor) ?
Regards, Desmond
|
|
|
|
|
ILDASM[^] will do this for you. It is part of the >NET Framework SDK[^]
Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg
|
|
|
|
|
Thanks. That did it.
How does it work (how can I make my own ildasm.exe theoretically) ? I mean, the compiled exe should be already IL (just in byte-code), right ? So what does ildasm actually do ? Does it just converst byte-code to text somehow or what ?
Regards, Desmond
|
|
|
|
|
Assemblies contain IL, which is similar to assembly language in sytax. So it should be fairly easy to write a tool like ildasm, all you need to know is the structure of .NET executable and the byte encodings for various IL instructions.
Regards
Senthil
My Blog
|
|
|
|
|
Hello,
I have some problems with user controls that I made.
Lately these controls have a bad habit of dissappearing when I open the form in designer.
It seems that visual studio messes up the generated code.
Is there a bug fix or a work around for this issue?
|
|
|
|
|
Hi all
I have a custom usercontrol in my window form "frmsett.cs" .
"initializecomponents" of "frmsett.cs" initialises usercontrol
This usercontrol is derived from a base component class.
Usercontrol populates printer informations.
we populate default printer related informations to usercontrol through Pinfo() method (a function in base component class )
Pinfo() invokes getinfo()(another function in base component class ) using methodinvoker and asynccallback
My "basecomponent" class definition starts with
[ClassInterface(ClassInterfaceType.None), ComVisible(false)]
when i call frmsett.showdialog() Applcation is developed and works perfectly in .NET framework 1.1
Then I installed .NET framework 1.1 SP1
Here the problem begins. When application executes ShowDialog(Only at first call) It hangs for some minutes (5-15 mins) before showing the dialog "frmsett" . If we clicked second time it will display the screen immedialtely.
Anyone come across this type of issues???
Is there any problems asynccallback with methodinvoker in .NET fx1.1 SP1
What is the reason for this problem in .NET fx1.1 SP1???
Thanks a lot for any tips !!!!
Regards
Krishnan
If u can Dream... U can do it
|
|
|
|
|
I am looking for a component in .net to send fax withing an ASP.net page.
I don't want to use a webservice nor to send fax over WEB.
All I need is a third party component that I can use it in my ASP.net application to trigger a fax modem installed on the server to fax an HTML page
Thanks
Arvind
|
|
|
|
|
hi,
i am using for my current project in that i have to search the html file for certain keyword like 'overrule' for searching this i am using regular expression.
i am able to search word 'overrule' but failed when the word 'overrule' is like this '[overrule'.
how i can do that? can anybody help me?
code is.........
Key_Word="overrul"
ObjRe.Pattern = Key_Word & "[a-z]"
Set ObjMatches = ObjRe.Execute(FileMatter)
lCnt = ObjMatches.Count
Thank in Advance
Syed
|
|
|
|