|
Hai Everybody,
I want to queue some events in the message queue and it has to be retained even though the system is restarted. I have created a message queue as follows but it is not retaining the messages can any one give a solution to this please it is very very important and urgent.
<br />
private System.Messaging.MessageQueue eventMessageQueue;<br />
if (!System.Messaging.MessageQueue.Exists(System.Net.Dns.GetHostName() + @"\EM"))<br />
{<br />
try<br />
{<br />
eventMessageQueue = System.Messaging.MessageQueue.Create(System.Net.Dns.GetHostName() + @"\EM",true);<br />
}<br />
catch (System.Messaging.MessageQueueException messagingException)<br />
{<br />
schedulerClass.LogError(messagingException, "Scheduler Error", EventLogEntryType.Error);<br />
}<br />
catch (Exception generalException)<br />
{<br />
schedulerClass.LogError(generalException, "Scheduler Error", EventLogEntryType.Error);<br />
}<br />
}<br />
else<br />
{<br />
eventMessageQueue = new MessageQueue(System.Net.Dns.GetHostName() + @"\EM");<br />
}<br />
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
hi,
May i know how to allow shapes drawn(e.g using DrawRectangle) on a window form to be drag and drop to a user control dock on the left side of the form? Can somebody explain briefly the step to do it? So Any help is much appreciated.
Thanks
|
|
|
|
|
Hi all
I cannot match between thread and process. Need to kill a cirtain thread, I know in general to what module the thread belongs but cannot distinct between the diffrent threads. all I get is a list of the threads ID that belong to my process....
|
|
|
|
|
Killing a thread is a bad idea in almost all cases. It can destabilise the entire process.
Steve
|
|
|
|
|
I know...... I have no choise. It's not my module.......
|
|
|
|
|
OK then, but it will end in tears!
Steve
|
|
|
|
|
Can I, at least, configure to what modoule does a cirtin thread belongs to?
|
|
|
|
|
No I dont think so.
AFAIK the managed threads are virtual, i.e. they are not even guaranteed to correspond to
a physical (i.e. a Windows kernel) thread.
This is somewhat illustrated by the fact that managed threads have a ManagedThreadId property,
whose value does not correspond to the kernel's thread IDs; and it has a name, for which
the kernel has no equivalent member at all.
In my experience, there still is a 1-to-1 correspondence between a managed thread and a
kernel thread, but I havent found any way to map them, other than having each managed thread
call some native code to get its own kernel thread ID that is.
Hope this clarifies things a bit.
|
|
|
|
|
I want to have a diagonal Line object as a usercontrol. It can automatic process events as click, drag and drop...Can you help me?
Thank a lot.
QuynhTD
|
|
|
|
|
Hello All,
I need to include a Dialog Box (Visual C++.Net or VC++6 style ) in a Visual C#.Net application at deign time but by default it is Form that is included and you can include by going to Add item.
Please suggest.
Thanks and Regards.
Amar.
|
|
|
|
|
Do you want to include Dialog box which are created in VC++ ? Is it anything like MFC COM (ActiveX) controls ?
|
|
|
|
|
No,
May it be created in C# and generated by the wizard as C# Form is.
Hope this clarifies.
Thanks.
|
|
|
|
|
Hi,
I created a settings file using Visual Studio 2005. The class for the settings file is generated as internal by VS. I need to reach it from another namespace so I want to make it public not internal. Is it good to make a settings file public or does it have any bad effects?
|
|
|
|
|
As it is internal, it's available in the entire assembly, even from a different namespace.
If you need to use the information in another project in the solution, you get a mutual dependency if you access the settings directly. Instead you should send the needed information when calling the method, or creating the object instance, that needs it.
---
single minded; short sighted; long gone;
|
|
|
|
|
I believe the cs file in question is machine generated so its no point making changes to that. Why dont you write your own class which can traverse the settings file using the XML namespace.
try this CP article
http://www.codeproject.com/useritems/SystemConfiguration.asp
|
|
|
|
|
Hi,
I am working on one winform using .NET 1.1. In My form Cancel Button is present. In cancel button code. i am using this.Close() method for closing the form.
if user clicks on top right side X button, Form Closing Event will fires.
how can i find weather a user clicked on Cancel button or X button???
experts any sounds.... ?
regards
GV Ramana
|
|
|
|
|
Hello,
In your CancelButton code (Click event handler), you could set the DialogResult property of the Form to DialogResult.Cancel.
So if the user Closes the Form over the 'X', the Default would be DialogResult.None.
private void CancelButton_Click(object sender, System.EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
protected override void OnClosing(CancelEventArgs e)
{
if(this.DialogResult == DialogResult.None)
{
}
else if(this.DialogResult == DialogResult.Cancel)
{
}
base.OnClosing (e);
}
Hope it helps!
All the best,
Martin
|
|
|
|
|
I am unable to add OnClosing Event.
Form is having only this.Closing event only
i.e., this.Closing += new System.ComponentModel.CancelEventHandler(From1_Closing);
plz tell me how to add OnClosing Event
regards
GV Ramana
|
|
|
|
|
You are wellcome!
All the best,
Martin
|
|
|
|
|
I am unable to add OnClosing Event.
Form is having only this.Closing event only
i.e., this.Closing += new System.ComponentModel.CancelEventHandler(From1_Closing);
plz tell me how to add OnClosing Event
regards
GV Ramana
|
|
|
|
|
OnClosing is th protected virtual method which fires the Closing event in the base Class (System.Windows.Forms.Form).
As you have your Form derived from Forms.Form, you don't have to handle the Event itselfe, you just can override the method.
Like I did!
All the best,
Martin
|
|
|
|
|
got it. & another problem.
everytime getting DialogResult as Cancel if i click on X button also. how do i get this?
regards
GV Ramana
|
|
|
|
|
Hello,
Now you also want DialogResult.Cancel set, if the user closes with 'X'.
Just set it in the Closing or Closed event.
All the best,
Martin
|
|
|
|
|
Hi Martin,
I dont think it will work your way. Windows already sets DialogResult to Cancel on
hitting the Close box.
This is why: Microsoft intends the Close Button to be identical to a Cancel
action; closing the dialog or pressing Cancel button both indicate "hey, I dont want this,
I am not interested". It is part of the overall GUI conventions that MS came up with.
And, we have had a difference of opinion on this before: one should not go against
such conventions.
|
|
|
|
|
Hello Luc,
Luc Pattyn wrote: I dont think it will work your way
Luc Pattyn wrote: Windows already sets DialogResult to Cancel on
hitting the Close box.
Have you tested it?
I did, with VS2003 .Net1.1!
Luc Pattyn wrote: And, we have had a difference of opinion on this before: one should not go against
such conventions.
Really?
Help me with long-term memory, when was that.
All the best,
Martin
|
|
|
|