|
I want to output data to the console from a button click on my WinForms application.
This is what I tried but with no call to the function aTest() was made.
Process myProcess = new Process();<br />
myProcess.StartInfo.FileName = "cmd";<br />
myProcess.StartInfo.Arguments = "aTest()";<br />
myProcess.StartInfo.UseShellExecute = true;<br />
myProcess.Start();<br />
Thanks
Kash
|
|
|
|
|
What you've done won't work. You've put together a command line that looks like this:
CMD aTest()
Try typing that into a Start/Run box. You'll find that it does the exact same thing as your code.
CMD doesn't know what to do with aTest() because it's not a valid command line argument for CMD . CMD cannot call back into your code to execute a method.
What I think you're trying to do is write to a console window that your application has complete control over. You can do this by redirecting the Streams of a CMD process. Check out this[^] article on MSDN, go about half way down the article, looking for Controlling Console Apps with the Process Class , and you'll see what I mean.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I've read some material and tried a few things but still no success.
If anyone has a snippet or small example; this would be very useful.
Kash
|
|
|
|
|
Hello,
I have a question regarding the inheritance of a sealed class. I would really want to know if it is possible inherit from FolderBrowserDialog. I want to extend the FolderBrowserDialog to do some checkings of the selected folder and to enable/disable the OK button. How can I do that in C#?
Larry
--
|
|
|
|
|
AFAIK it is not possible: the sealed attribute is made intentionally to avoid inheritance. I believe also the CommonDialog Win32 libraries are sealed.
[ITA] Tozzi ha ragione: Gaia si sta liberando di noi.
[ENG] Tozzi is right: Gaia is getting rid of us.
|
|
|
|
|
You cannot inherit from this class becuase this class is marked as sealed.
-Atul, Sky Software http://www.ssware.com
Shell MegaPack For ActiveX & .Net - Windows Explorer Like Shell UI Controls
|
|
|
|
|
I create FolderBrowseDialog and show it, but the treeview control [with directories] isn't visible
[code]
private System.Windows.Forms.FolderBrowserDialog oAddDir;
this.oAddDir = new System.Windows.Forms.FolderBrowserDialog();
public void OpenDir()
{
oAddDir.ShowDialog();
}
dialog is visible but without one control: - treeview
|
|
|
|
|
Did you set the COM threading model for your application to multithreaded apartment (MTA)?
[System.MTAThread]
static void Main()
{
I've learned the hard way that in this case the described error occurs in FolderBrowserDialog and you have to use the single-threaded apartment (System.STAThread).
www.troschuetz.de
|
|
|
|
|
I tried. but it is not working. The form which is use the folderBrowseDialog is a singleton form.
In other applications it works fine.
|
|
|
|
|
plz paste the code of serial port programming in c# here
thnx
|
|
|
|
|
Please, please, please try at least to search CP first...
however:
http://www.codeproject.com/csharp/csppleds.asp
http://www.codeproject.com/csharp/cspplcds.asp
[ITA] Tozzi ha ragione: Gaia si sta liberando di noi.
[ENG] Tozzi is right: Gaia is getting rid of us.
|
|
|
|
|
|
What site are you on? CodeProject maybe???
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
oook i didn't know the nick of code project
well i had tried to find this topic on CP urgently but due to lack of time i made it a seperatet topic
thnx for the help u all
|
|
|
|
|
it is... CodeProject.com !!!
I'd like to make you understand that in CodeProject there are so many articles that it is very rare that you don't find something concerning what you're looking for.
cheers
[ITA] Tozzi ha ragione: Gaia si sta liberando di noi.
[ENG] Tozzi is right: Gaia is getting rid of us.
|
|
|
|
|
try to search on CP, and googling
<< >>
|
|
|
|
|
|
Hi all,
I have placed no of Richtext boxes on the form
and i want to show all of them in the Print Preview
as different pages.
Any help will be appreciated
Regards,
Pramod
|
|
|
|
|
Hi,
i am working on MSHTML and AxWebBrowser in c#.net(Desktop Application). i have
to scan lot of HTML pages.After Navigate the page "WebBrowser Document is
converted into IHTMLDocument2".so that i can scan pages through MSHTML. i am
using the following code.
1. this.axWebBrowser1.Navigate(URL,ref zero,ref nullStr,ref nullStr,ref nullStr);
2. Process.Start(NavigateFile);
3. mshtml.IHTMLDocument2 doc=(mshtml.IHTMLDocument2)this.axWebBrowser1.Document;// Problem
is here
4. mshtml.IHTMLElementCollection AllElements=doc.all;
Problem here is on 3 step. this step is excuting before the page is rendered. it gives me the error
that "Object reference is not set". what i want is this 3 step will not excute unless and until the page is
rendered or download properly. Please tell me what condition I will use before 3 step so that it can not
excute until
the page rendered.
i would like to know in details about MSHTML and AxWebBrowser. Please tell me from where can i
get the articals and sample code for this topics.
Thanks & Regards
Amit Grover
Amit Grover
CDAC R&D
Gist Group
pune
|
|
|
|
|
Hi. You will need to postpone steps 3 and 4 until after you receive the NavigateComplete2 notification. This[^] Google search will help you find the information you need.
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|
for example, run the app, type in a message or something, click send or whatever, person somewhere else recieves message.
What do i use to do something like that?
(This is for learning purposes only)
|
|
|
|
|
You need be alot more specific here ... there are probably at least 100 ways to do this
|
|
|
|
|
I need to place an ICON(very small) in a cell in a datagrid.
The icon may taken from the HDD or even a binary array taken from a databse.
Please provide me a way 4 it.
Original Idea : Depending on a boolean value i want to display an icon in the cell.
eg:
TRUE - Green Color right sign
FALSE - Red color cross sign
varunajeewa.LK
|
|
|
|
|
Why don't you try to change the background of these cells into green or red?
I Don't know it it's possible, but it would be easier if it is...
|
|
|
|
|
Hi there,
is there a way to know if the device has the data 100% available for reading?
What i do is the following:
a) send a write to the device [a request to 'gather' stuff for me to read later]
b) read the 'prepared' data
I use System.IO.Ports.SerialPort from the .Net 2.0 framework.
It seems that the write/read [a & b] part is too fast for the device. It does not have all data prepared.
Sometimes the data need to read is 10 bytes, an other time it is 20000 bytes. No 'logic' there.
Is there a way to tell if the device has the data complete for me to read back to the pc?
Thanx,
Jan
[ps. this is like a post i did earlier, however this is addressing the actual problem better]
|
|
|
|