|
|
Good Day Sir/Maam,
I have now finished by project and have created a *.hlp file using WinHelp.
I have a Menu Bar and it contains a HELP menu.
Is it possible that when the user clicked on the HELP menu, the *.hlp file will run?
Thank you in advance.
|
|
|
|
|
Hi.
Yes it's possible. If you have your help file in the same catalog as program, you can use this code:
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "Help.hlp";
p.Start();
|
|
|
|
|
Very nice. Did the job.
Thank you sir.
|
|
|
|
|
|
I am using .NET 2005 c# with NHibernate 1.0.2, with the method CreateCriteria, it return value is IList, but in .NET 2005 only has IList<>. how to convert IList to IList<> or how to slove it problem
|
|
|
|
|
Hi.
You can use IList interface in .NET 2.0, it's situated in System.Collections namespace. But answer to your question you'll find on this page:
http://dimapasko.spaces.live.com/blog/cns!19D0AD1FA1CDA8!138.entry
and
https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=966134&SiteID=1
|
|
|
|
|
|
Hi All,
Greetings. When I am tring to send mails from my domain using System.Web.Mail.
System.Web.HttpException: The transport failed to connect to the server. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80040213): The transport failed to connect to the server. --- End of inner exception stack trace --- at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) at System.Web.Mail.SmtpMail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) --- End of inner exception stack trace --- at System.Web.Mail.SmtpMail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) at System.Web.Mail.SmtpMail.CdoSysHelper.Send(MailMessage message) at System.Web.Mail.SmtpMail.Send(MailMessage message) at _Default.Button1_Click(Object sender, EventArgs e)
This is the error I am getting. Please help me on this issue. Thanks in advance...
JIJO BABY - Lets Play C#
|
|
|
|
|
|
|
|
My program uses multiple threads to do something, and i want to make a progress bar to show the process status, the problem is that i can't update the progressbar from the thread (gives an exception..not the thread it was created on).
what can i do?
|
|
|
|
|
Use the standard technique (InvokeRequired/Invoke) explained over and over in CP articles;
both of my articles contain a simple example.
|
|
|
|
|
Uhh...well...I read a bit and it seems to be really confusing...a small simplified example would be nice :\
|
|
|
|
|
Hi, the last code snippet in my Sokoban article shows the simplest example possible:
executing a method with one argument on the UI thread (it is an excerpt from file
MainForm.cs)
|
|
|
|
|
Uhh...i don't get it (especially cause I'm not very familiar with delegates...so can you explain what this does:
Invoke(new MovePaster(pasteOneMove), new object[]{c});
You send a function into a delegate? but the function is void and has a char as a parameter (And so does the delegate)...so...uhh...I'm confused :\
|
|
|
|
|
Hi, whenever you create a Win app in .NET you use delegates; how else would you connect
an event handler (e.g. myButton_Click) to the corresponding event ?
When you write
myButton.Click+=new EVentHandler(myButton_Click);
you pass a method to the handler's constructor; this does not call myButton_Click,
it tells the button that when clicked it will have to run myButton_Click for this object.
This is fundamental to .NET, whether using C# or not.
Invoke is similar, the line
Invoke(new MovePaster(pasteOneMove), new object[]{c});
will cause the execution of the specified method (with specified argument list), so it
logically corresponds to a simple pasteOneMove(c);
but it does not execute the method on the calling thread, it sends a message to the
message pump and that message causes pasteOneMove(c); to be executed on the UI thread.
A delegate is used gfor this; it is an object used to combine the relevant object and
method in a structured (type-safe) way.
I recommend you read more about this in any .NET programmers book, then have a look at
some of the many examples around.
|
|
|
|
|
So if i want to update my progress bar...i need to do something like this?
private delegate void SetPrecentage(int p);
<br />
private int DoOperation(int p)<br />
{<br />
if (this.InvokeRequired){<br />
Invoke(new SetPrecentage(DoOperation),new object[]{p});}<br />
}<br />
but then...how do i like, update the progress bar?
|
|
|
|
|
Do that in the else block.
private int DoOperation(int p)
{
if (this.InvokeRequired)
{
Invoke(new SetPrecentage(DoOperation),new object[]{p});}
}
else
{
}
|
|
|
|
|
but i mean, it will never run on a UI thread, so how do i update the progressbar? what will invoking p do? :\
|
|
|
|
|
The else code runs on the UI thread. When you call BeginInvoke or Invoke and pass it a delegate, .NET calls the delegate on the UI thread. In your example, you passed the same function as the delegate. When .NET calls the function on the UI thread, InvokeRequired will be false and the else code will run on the UI thread.
Have a look at What's up with BeginInvoke[^] to know more about this.
|
|
|
|
|
hi
i have sql server 2000 personal in server, and i want connect to it from client by vc#2005, but the following error shown me :
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
how to solve my problem ??
thanks
-- modified at 18:58 Friday 2nd March, 2007
|
|
|
|
|
|
I am working on a POS application that needs to run once, and then when called again it will just activate the current instance. So I have the run once code working but now I need to be able to pass params to the running instance. I am trying to implement a way to save the params to my properties.settings.default.param1, so when the exe is called the second time, I check for an existing instance by name, and if I find it I restore it. before I restore it I save the value of my params, and in the activated event of my form, I grab that data and present it to the user. Well this is not working all the time, sometimes it works sometimes it does not...I'm totally open to new ideas on this process...
Christopher J. Thornburg
Senior Systems Analyst
Ideal Card
|
|
|
|