|
Luc Pattyn wrote: the SerialPort events run on a ThreadPool thread; what would keep you from having an overall try-catch in their event handler?
How would one go about doing that? If I get a threadpool thread (e.g. using Delegate.BeginInvoke) and enter a Try-Catch, the pool won't be returned to the threadpool (and thus be available to SerialPort) until after the Try-Catch block has existed. How would one wrap the SerialPort's handlers in a try/catch block? If I try to read data from a SerialPort object which has opened a USB-to-serial converter, and the USB cable gets unplugged, I get an unhandled exception in an alien thread (often SafeHandle was Disposed, but various factors may cause different ones).
|
|
|
|
|
No, you put the try-catch in the handler, not the other way around.
void serial_DataReceiver(...) {
try {
...
} catch(Exception exc) {
log(exc.ToString());
...
}
}
|
|
|
|
|
It doesn't matter how many threads you have in your application, they are all hosted in the same AppDomain
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
You might want to go through this article.
|
|
|
|
|
Hi,
Thanks for the article, however, it describes how to implement _custom_ unhandled exception class.
What I want to get is _default_ handler, just like I get it in vs 2005 project.
Any other ideas?
|
|
|
|
|
Try running DevEnv /resetsettings from your command prompt (at your own risk).
This will reset all your VS 2008 settings.
|
|
|
|
|
Nop, didn't help. Still no default windows form unhandled exception dialog...
|
|
|
|
|
Hi,
I have craeted one dll.some body cracked that dll.whether ASP.NET provide any alert message or any information to that owner of dll
|
|
|
|
|
your question is not clear..,
if That DLL is developed by you.., YOU R THE OWNER
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
Edit the post to make your question clear. It is very hard to understand what you are asking.
|
|
|
|
|
Your question isn't entirely clear.
But, if you're asking if there is any way to have a .NET DLL "phone home" and tell you that someone cracked it, no. Since .NET .DLL can be easily decompiled using Reflector, and your .DLL code is not running at the time, your code will never know that someone looked at it using Reflector.
|
|
|
|
|
well, if cracked means modified - making an assembly strong-named provides a guarantee that the assembly have not been changed since it was built.
Gabriel Szabo
|
|
|
|
|
Hi All,
I've got the following code, which runs an exe with some switches and then sends the log file to me, or at least it's supposed to.
I receive the email ok, but no attachment.. the code compiles fine..
has anyone any ideas??
<br />
MyProcess.StartInfo.FileName = "printmig.exe"<br />
MyProcess.StartInfo.WorkingDirectory = "c:\print backup"<br />
MyProcess.StartInfo.Arguments = "printmig.exe /b /i"<br />
MyProcess.Start()<br />
<br />
MyProcess.WaitForExit()<br />
<br />
<br />
Dim objMail As New System.Net.Mail.MailMessage()<br />
Dim obj As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient<br />
Dim Mailmsg As New System.Net.Mail.MailMessage<br />
Mailmsg.To.Clear()<br />
Mailmsg.To.Add(New System.Net.Mail.MailAddress("receivers address"))<br />
Mailmsg.From = New System.Net.Mail.MailAddress("senders address")<br />
Mailmsg.Subject = "(subject text)"<br />
<br />
Dim attachment As New System.Net.Mail.Attachment("C:\file.log") 'create the attachment<br />
objMail.Attachments.Add(attachment) 'add the attachment<br />
<br />
<br />
Try<br />
Mailmsg.Body = ""<br />
obj.Host = "external smtp server" ' Modify to YOUR smtp server<br />
obj.Send(Mailmsg)<br />
Catch ex As Exception<br />
Write("Error: " & ex.ToString())<br />
<br />
Cheers
nhsal69
|
|
|
|
|
You are adding the attachment to objMail
objMail.Attachments.Add(attachment)
but you are sending Mailmsg
obj.Send(Mailmsg)
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
obj.Send(Mailmsg)
Mailmsg.Send(Mailmsg)
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
Doh!
thanks for that... I'll just get my coat.. TAXI!
|
|
|
|
|
Hi All,
I have created one DLL having some functions as follows..
I want to call them from VB.net and C#.net.
1) Function CONVERTPWDATA ( PASS1,PASS2 : INTEGER; IpStr : PWord; OpStr : PChar;
LangName : LongInt; AFontType, BFontType : LongInt ) : PChar; StdCall;export;
2) Function CONVERTDATAEX ( PASS1,PASS2 : INTEGER; IpStr : PChar; OpStr : PWord;
LangName : LongInt; AFontType, BFontType : LongInt ) : PChar; StdCall;export;
Can anyone help me for Compatible Data types in .net for Delphi Data Types..
My Second Question IS
How to pass Unicode Data from .net and How to receive it back from Delphi DLL.
Thanks in Advance..
I have never failed,I just found 1000 ways that never works.
Regards,
Victory.
|
|
|
|
|
can use .net framework for this purpose right? please guide me if i'm wrong. How do i get around with this?
|
|
|
|
|
guess you are looking for this[^]
|
|
|
|
|
i believe that is about still images? what about recording a video? any lead please? tq
|
|
|
|
|
well, thats a start point. You need to find ways to handle videos in c#. there are some open source libraries available. google for them.
a simple search in CodeProject would have given you the answer as well.
Anyways here
|
|
|
|
|
|
tq very much helps a lot
|
|
|
|
|
Hi !
I'm currently making a custom TreeView inheriting "ScrollableControl" and all parts are painted with GDI. Now, I'm going to implement the checkBox and I would like painting them too.
Is it reasonable for the performances of the application to paint controls instead of adding real controls ?
I have the same question for all parts like the "arrows / plus-minus" icon.
I want adding possibility to format the node text. Adding colors for some words or underline ...etc...
Actually, this text is painted too with GDI "DrawString". What is the best solution for you to format this text easily for the control user ?
Asking to user to enter RTF formating or Html formating and parse it before paint ?
|
|
|
|
|
Hi,
maybe not directly an answer to your question, however: have you read the documentation on ControlPaint class?
|
|
|
|