|
arnold_w wrote: What character(s) should my console application send to indicate end-of-stream
There might not be one. I suppose you could try sending 0 thru 255 and see if any work. Or you might follow the advice in the Remarks section of the documentation[^]
|
|
|
|
|
Thanks for your tips.
There doesn't seem to one character that indicates end-of-stream. It didn't work either to call Console.Out.Close() in the console application.
|
|
|
|
|
One thing that should be sufficient is for the console app to exit.
Closing the stream seems reasonable, but maybe a console app doesn't let you do that (except by exiting).
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
I think you'll need to make another plan.
|
|
|
|
|
I solved it by writing a null character ( (char)0x00 ) when I am finished writing in the console application and the GUI investigates the received characters on the fly and stops when a null character is found.
Thanks anyway to everybody that replied to this thread.
|
|
|
|
|
AIM: TO DISPLAY IN CRYSTAL REPORT
typee ex1 ex2 ex3 ex4 date
NAME Q V Q V Q V Q V
RAVI 100 1000 200 2000 2 200 3 300 2/5/2009
PRAVEEN 0 0 0 0 0 0 1 1000 2/5/2009
IN SQL SERVER 2000
I HAVE TAKEN TABLE AS FOLLOWES
EMPID EMPNAME START DATE TYPE Q v
1 RAVI 02/05/2009 ex1 100 1000
1 RAVI 02/05/2009 ex2 200 2000
1 RAVI 02/05/2009 ex3 2 200
1 RAVI 02/05/2009 ex4 3 300
3 PRAVEEN 02/05/2009 ex4 1 1000
.. .. .. .. .. …
|
|
|
|
|
1. be specific
2. don't shout
3. Oh, I don't feally care.
This is Crystal Reports!!!
There are millions of sick children, malaria is rife, pig flu is spreding, my medication is wearing off and you expect help with CR? Get some perspective and tell your teacher your dog ate your homewirk,
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
And the question is....???
|
|
|
|
|
I need to play video from url. For example http://somesite/1.flv
Where should I start? Any simple example?
Thanks.
|
|
|
|
|
An flv file is typically played back by a swf ( a flash movie ). Buy or find an flv player, and embed it in your app.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Billy reports error 87, "The parameter is incorrect" on my x64 machine.
public struct INPUT
{
public int type;
public MOUSEINPUT mi;
}
public struct MOUSEINPUT
{
public int dx;
public int dy;
public int mouseData;
public int dwFlags;
public int time;
public int dwExtraInfo;
} [DllImport("User32.dll", SetLastError = true)]
public static extern int SendInput(int nInputs, ref INPUT pInputs, int cbSize);
...
input.type = INPUT_MOUSE;
input.mi.dx = 0;
input.mi.dy = 0;
input.mi.mouseData = 0;
input.mi.time = 0;
input.mi.dwFlags = 0;
input.mi.dwExtraInfo = 0;
SetForegroundWindow(hWndC);
RECT textWindowRect = new RECT();
GetWindowRect(hWndC.ToInt32(), ref textWindowRect);
// Put Cursor on 1st line of the text box
input.mi.dwFlags = (MOUSEEVENTF_LEFTDOWN|MOUSEEVENTF_ABSOLUTE);
input.mi.dx = textWindowRect.right - 30;
input.mi.dy = textWindowRect.top + 2;
resSendInput = SendInput(1, ref input, Marshal.SizeOf(input));
if (resSendInput == 0)
{
string errorMessage = new Win32Exception(Marshal.GetLastWin32Error()).Message;
MessageBox.Show(errorMessage);
}
The error occurs on this SendInput. I know that the dx and dy calculations are correct cuz the following statement works if i substitute it for the SendInput:
SetCursorPos(textWindowRect.right - 30, textWindowRect.top + 2);
This is mi at time of error message:
mi {MyBuddy.Form1.MOUSEINPUT} MyBuddy.Form1.MOUSEINPUT
dwExtraInfo 0 int
dwFlags 32770 int
dx 251 int
dy 526 int
mouseData 0 int
time 0 int
The whole idea of running 32-bit code on a 64-bit machine boggles my mind. After messing with this for about 20 hours ... I'm getting a headache!
|
|
|
|
|
Hi,
AFAIK there is a problem in your MOUSEINPUT struct: the extraInfo field is a pointer (IntPtr), not an int, and it takes 8B instead of 4B on X64.
BTW: there are a lot of such errors on the web, even on www.pinvoke.net
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Thanks Luc. There is no question you are correct.
I was aware of the 8b vs 4b difference. I guess what i don't understand is how 64-bit machines can run 32-bit DLLs. Why is it that the 32-bit DLL is not expecting 32-bit pointers?
Sorry for delay in getting back here.
|
|
|
|
|
I have developed a component(CCW) using C#. It contains one static method with sleep statement (e.g. Thread.Sleep (10000);).
Instance of this component is created in ASP page.
If I open one browser and access asp page, it sleep for 10 seconds,
but Whenever I open more browsers (from different machines) and access asp page, some instances sleep for more than 10 seconds.
Can you suggest me what probable cause of this behavior?
|
|
|
|
|
Thread.Sleep instructs the thread to Wait for "about" x number of milliseconds. The thread-priority will dictate the actual wait. If timing is important use a smaller wait and a loop check for time. I'm not really going to go into using Threads and Waiting in ASP.NET (which IMHO shouldn't be done).
|
|
|
|
|
I've got a fairly complex form (~1200 lines in the designer file). Some of the time when I open the form VS spends several seconds spasticly redrawing a few ever larger sections of the form before blanking the tab and redrawing the entire form from scratch.
Since the solution began in VS2k3, I'm wondering if the controls listed in the order that would make the designer happy. Does anyone know of an ordering that the designer would be expecting that I could manually fix the code into?
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
When a form gets to be a burden to design I add the
[System.ComponentModel.DesignerCategory("code")]
attribute which usually helps (must be fully qualified)
Also, try closing all open files.
|
|
|
|
|
Did you edit the Designer generated code?
does it still contain the useful calls to SuspendLayout and ResumeLayout for all complex Controls (including your Form itself) and surrounding the operations on those Controls?
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
The form was originally created in VS2k3 which didn't support partial classes. At that time I occasionally 'edited' it after the designer (seemingly) randomly moved stuff around to avoid crapping my diffs up with junk. Otherwise the only thing i did was to add xml comments and #warning TODO blah blah notes to a few objects.
There are suspend/resume layout calls for the form and the two group boxes that contain most of the controls within InitializeComponent() . The SuspendLayout calls come right after all the foo = new foo() calls, The ResumeLayout and PerformLayout calls are near the end of the method. On both ends they're interspersed within ((System.ComponentModel.ISupportInitialize)(this.foo)).BeginInit(); and corresponding EndInit calls. I've also noticed that only one of the two groupboxes has a PerformLayout call. Since I've never intentionally meddled with this stuff I'm not sure if that's correct or not.
The form also has a ReSise event handler, but AFAIK the designer ignores that.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
Sounds all right.
Here is my suggestion: start a new form just for watching, add a few Controls that interest you, and look at the Designer.cs file.
Now, probably using some editor outside Visual Studio, split your original file in the same manner, making sure all the special method calls (Suspend/Resume/PerformLayout, Begin/EndInit) are as the Designer does it.
Back in VS add the new file to the solution, rebuild and hopefully enjoy. (if so, don't touch it ever again).
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi all
I have combo box with following properties:
DropDownStyle : DropDown
AutoCompleteMode : SuggestAppend
AutoCompleteSource : ListItems
Key Press event :
private void comboBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Enter)
{
MessageBox.Show("Test");
}
}
When the Focus is at Combobox i pressed Enter Key but it is not entering into key press event.
How to capture the Enter Key?
Thanks in advance,pls help in this?
|
|
|
|
|
I would try the KeyDown event.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
No sure if this has got anything to do with it but try overriding IsInputKey and/or IsInputChar to return true (at lease for Enter key). This is neccessary if you want to capture keys like Tab, Arrows etc., don't know about Enter.
Also, the Keys enumeration has entries for both Enter and Return , you can try if the are any different - one may work, the other not, who knows
|
|
|
|
|
I have a regular C# GUI-application which calls a console application using
<br />
ProcessStartInfo psi = new ProcessStartInfo();<br />
psi.FileName = "myConsoleApp.exe";<br />
psi.Arguments = "myArgument"; <br />
psi.WindowStyle = ProcessWindowStyle.Hidden;<br />
Process myProcess = Process.Start(psi);<br />
myProcess.WaitForExit();<br />
MessageBox.Show("myConsoleApp finished. Return code: " + myProcess.ExitCode);<br />
I would like to pass more information (for example, a string) than the exit code from the console application to the GUI. How do I do that? Can I somehow use a pipe so that everything written in the console application using Console.Writeline() goes to the GUI?
|
|
|
|
|
There may be better methods, but how about the console app writes or serializes the required data to a file? The GUI app can then read/deserialize the data.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|