|
Hi,
you should use the "ReadLine" method instead since it reads the response until it receives a "NewLine" (\n).
Try:
private void serialPort1_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
TxtOutPut.Text = serialPort1.ReadLine();
}
|
|
|
|
|
Wow !
Thank you so much , Sir , Very Smart replay !
Here is (5)
P.S:
How I could not realize that ,
I know nothing , I know nothing ...
|
|
|
|
|
The alternative is to wait a while inside the DataReceived handler, so more/all data can come in before you get it all. Say 100 msec.
Or, if you need it fully event driven, start a timer in DataReceived, and read in the Tick handler (don't forget to stop the timer again).
|
|
|
|
|
Nice , I Will try the 100 Msc Things , I think it worth
Since I found more easy than the ReadLine() function ,
Thank you Sir ,
I know nothing , I know nothing ...
|
|
|
|
|
Stark DaFixzer wrote: P.S:
How I could not realize that
By reading the documentation on MSDN[^].
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Hi.
I'm writing my own filter in C++ and C#.
How i can change audio format ac-3 to lpcm , during playing video/audio ?
How i can do dinamic format change?
Can anybody help me ?
Thanks.
We are haven't bug,just temporarily undecided problems.
|
|
|
|
|
Hi all,
I have used many time C++ DLL which export functions in C#.net project by using DLLimport. Now i have a C++ DLL which exports classes, so can any body suggest me how can i use C++ DLL classes in my C# project.
Thanks
Bankey
|
|
|
|
|
|
Hi, thanks for your response,
is it possible to use c++ classes from C++ DLL in C# without making wrappers.
i also read this article and other many article, all the article tells i need to make a wrapper for everry class and its members to use in C# project.
if wrapper is only solution than i want which approach will be best like managed C++ wrapper and unmanaged C++ wrapper
Thanks
Bankey
|
|
|
|
|
If possible you can also rewrite your C++ code to managed C++. This can even allow you to use the same source for unmanaged applications and for managed ones. At work we have such a kind of library that uses a lot of compiler switches to determine if the code is to be used with .NET or not.
|
|
|
|
|
bankey1010 wrote: is it possible to use c++ classes from C++ DLL in C# without making wrappers.
No, since the C++ classes are not managed code. Your either need to write a wrapper around it or rewrite the C++ code in C++/CLI (Managed C++). Which you chose is entirely up to you.
|
|
|
|
|
So I am trying to give the user an option of removing registry keys when uninstalling my application (the installer is the windows installer with visual studio).
The problem is it appears the message box appears behind the uninstaller (sometimes). Here is what I am doing:
public CustomInstaller() : base()
{
InitializeComponent();
base.AfterUninstall += new InstallEventHandler(CustomInstaller_AfterUninstall);
}
public override void Uninstall(IDictionary savedState)
{
base.Uninstall(savedState);
}
void CustomInstaller_AfterUninstall(object sender, InstallEventArgs e)
{
DialogResult result = MessageBox.Show("Do you want to remove all settings? (This is not reversible)", "Remove Settings",
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
try
{
Registry.LocalMachine.DeleteSubKeyTree(@"Software\JD Development");
}
catch (Exception ex)
{
MessageBox.Show("Unable to remove registry settings: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
Process.Start("sc", "delete JDAgent");
}
|
|
|
|
|
I googled (you can do this too) and found some solutions:
1.:
MessageBox.Show(new Form(){TopMost = true},"I'm still on top, YEAH");
2.:
TopMost MessageBox[^]
3.:
[DllImport("user32.dll")]
public static extern int MessageBox(int hWnd, String text, String caption, uint type);
Then just call MessageBox with MB_TOPMOST
|
|
|
|
|
Yeah I was working on this late night and didn't find anything. Just had my wording screwed up in my search parameters instead of just top most messagebox. I dunno. Thanks for the reply.
|
|
|
|
|
I create my own csv file via Microsoft Excel 2003, then I need to read it with my c# application.
It's impossible to read it correctly because the fields are separated by a comma and I have some fields that include commas which are not supposed to be separators.
I have heard that csv separators could be also TAB chars.
Is it possible to save the CSV file with tabs instead of commas as separators?
Is there any other way I can solve the problem?
Thanks from advance,
benams
|
|
|
|
|
I would suggest using a third party library, like this one[^] to parse the CSV. The code you're using doesn't take into account that string fields in a CSV should be enclosed in quotes if the field contains the seperator character. If you wrote this code, you're not tracking the use of quotation marks properly, if at all.
|
|
|
|
|
What Dave said.
And then there are some CodeProject articles that could help out, here is one: Rive[^]
|
|
|
|
|
|
|
I suggest using the Jet Engine and ADO.net to access the XLS file directly rather than using CSV.
|
|
|
|
|
I believe Jet is not supported on 64 bit windows.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
It is for 32 bit programs.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hi,
How can I save the StackTrace into mySQL? is't too long for varchar? should I use TEXT?
Thanks.
|
|
|
|
|
type text is very good for holding text.
|
|
|
|
|
The stack trace can be huge, I've had problems with it truncating in the past. You might want a squizz at this[^] if you are using SQL 2005.
|
|
|
|