|
stancrm wrote: from my experience, in that row, the dll create a new thread, and the new thread throw an exception.
There is no new thread created in that code.
|
|
|
|
|
|
|
You should review of Execute method code.
A DATAPOST COMPUTER CENTRE
(K.V Prajapati)
|
|
|
|
|
Hi here the Execute method is crashing......
Here my problem is that my application is not able to catch that exception.( those exceptions occurs inside the dll)
My small attempt...
|
|
|
|
|
Because you've swallowed the exception (and logged it according to your comments) rather than rethrowing it.
try
{
}
catch(Exception ex)
{
throw;
}
now the calling application will receive the exception.
|
|
|
|
|
There may be some mistake in my question .let me explain it once more....
<pre> try
{
// This function is inside the DLL
Function();
}
catch ( Exception ex )
{
// Log exception
}
//Inside the DLL
public void Function()
{
// something which is crashing.......
}
what i am saying is i am not getting the exception which is occuring inside the dll....
My small attempt...
|
|
|
|
|
If you are not getting the exception, how do you know Function is crashing?
|
|
|
|
|
Please come to my question............. ]if i put try catch inside the dll , that will catch the exception
My small attempt...
|
|
|
|
|
|
For what?????
Hi all please understand my question..............
1. I am calling a method from an application ( example APP) ,which is inside a dll( example DLL)
2. Just assume that that method is crashing( in side DLL)
3. I want to catch the exception in the calling application( APP)( the application from which i called the dll method)
---------------------------------------------------------------------
My small attempt...
|
|
|
|
|
|
"if you cannot catch the exception from method Execute, that means there is something wrong in the method." please try to understand that i dont want to find the root cause or reason for the exception... i want to catch the exception in the c# application which calls the DLL.............
Please imagine that i put some code which generates exception.I dont want to debug and find the reason i just want to catch it on my application...
My small attempt...
|
|
|
|
|
Hello All,
I am Savitri Here. I am new to this forum and also to this language. I am doing one application in C#. Now i have two forms called Mainform and LoginForm. After running we login form will come and after successful login will get mainform. I want to assign the entered user name to toolstripstautuslable of statusstrip which is in mainform.When i clicking login button then only i am setting new value for that status strip but it is not assigning. Please help me. Below is the part of code.
LoginForm.Cs
<br />
MainForm frm = new MainForm();<br />
private void btnLogin_Click(object sender, EventArgs e)<br />
{<br />
string username,password;<br />
username=txtUsr.Text.ToString();<br />
password=txtPwd.Text.ToString();<br />
if(username.Equals("xxxxxx") && password.Equals("xxxxxx"))<br />
{<br />
MessageBox.Show("SuccessFully Logged in");<br />
frm.toolStripStatusLabel2.Text = txtUsr.Text;<br />
frm.GetValues(username, password);
this.Visible=false;<br />
}<br />
else<br />
{<br />
MessageBox.Show("Not valid UserName and Password");<br />
}<br />
<br />
}<br />
MainForm.cs
public void GetValues(string strUsr,string strPwd)<br />
{<br />
this.UsrNam=strUsr;<br />
MessageBox.Show(UsrNam);<br />
this.PasPwd=strPwd;<br />
MessageBox.Show(PasPwd);<br />
this.toolStripStatusLabel2.Text = UsrNam.ToString();<br />
this.Refresh();<br />
}
Please Give me hints. Help me.
Thanks in Advance.
Regards,
Savitri P
|
|
|
|
|
Does this line MessageBox.Show(UsrNam); show the username?
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.”
|
|
|
|
|
Hi Henry,
Ya that is user name. I want to display that user name into status strip in main from. Please give me some hints to solve this problem.
Thanks in Advance.
Regards,
Savitri P
|
|
|
|
|
Yes, I understand that, but when the MessageBox displays, does it show the username, is it blank, does it display something that you are not expecting?
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.”
|
|
|
|
|
Ya it is displaying username in messagebox but it is not showing in status strip and not refreshing control also. I tried many ways but it is not displaying.
Regards,
Savitri P
|
|
|
|
|
The code you have provided, is over complicated:
your code:
public void GetValues(string strUsr,string strPwd)
{
this.UsrNam=strUsr;
MessageBox.Show(UsrNam);
this.PasPwd=strPwd;
MessageBox.Show(PasPwd);
this.toolStripStatusLabel2.Text = UsrNam.ToString();
this.Refresh();
}
can be simplified to:
public void GetValues(string strUsr,string strPwd)
{
this.UsrNam=strUsr;
MessageBox.Show(UsrNam);
this.PasPwd=strPwd;
MessageBox.Show(PasPwd);
this.toolStripStatusLabel2.Text = UsrNam;
}
other than that I can see no obvious reason that it should not work.
As a test that toolStripStatusLabel2 is working, temporarily replace this.toolStripStatusLabel2.Text = UsrNam; with this.toolStripStatusLabel2.Text = "Is this visible"; .
If you can see "Is this visible" when you run the application, then I am at a loss. If however, you cannot see it, then there is something wrong with one of the properties of toolStripStatusLabel2 possibly the Visible property is set to false, possibly the location or size properties are incorrectly set. It might even be hidden behind another control.
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.”
|
|
|
|
|
Hi Henry,
Thanks a lot.I got the result correctly. Thanku very much.
Regards,
Savitri P
|
|
|
|
|
My pleasure.
Good Luck.
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.”
|
|
|
|
|
I've searched the forums, but I lack the proper keyword, and need a nudge in the right direction.
Amateur programmer:
Somebody told me that the login/logout times of past 3 weeks are stored somewhere on the pc:
I;m not bothered, whether this is System specific, or user specific, but I need to know where they can be queried;
Options:
- Registry
- Edirectory
- ActiveDirectory
Anyone experience?
|
|
|
|
|
vincentnl78 wrote: Somebody told me that the login/logout times of past 3 weeks are stored somewhere on the pc:
No, they're not.
The only place that would have anything like this would be the Security event log, which IIRC, by default, doesn't log user logon/logoff events.
ActiveDirectory does not keep track of the last 3 weeks either.
|
|
|
|
|
Well, the answer is still usefull;
I;m trying to dectect when the PC was turned on; by sifting and screening through all the logs, i can detect activity;
Security log might be best bet;
tx
|
|
|
|
|
Not really. The system being turned on will only show in the security log as a SYSTEM account login event, IF the machine is configured to log these events. Shutdown may or may not show up, but usually doesn't. Again, it depends on what is being logged.
There really isn't any 100% foolproof way to get what you want unless you specifically setup group policy in an ActiveDirectory environment to log all this stuff.
|
|
|
|