|
|
|
I need to know that return parameters of SetSystemTime function (that has been located coredll.dll of windows ce 5.0 device) usually returns 1 return type uint. but sometimes i cannot set device time. Is there any idea ?
thanks to all
|
|
|
|
|
|
I have the same problem. The marshal tells me that error 57
Have you managed to solve it?
CE 5.0
c# CF 2
|
|
|
|
|
i think i solve it
it was so before...
codes at home let me check @ home and send it
|
|
|
|
|
Which are the settings in web.config file for sending the Emails thr' SMTP?
Sarika Wake
|
|
|
|
|
using System.Net.Mail;
...
SmtpClient smtpClient = new SmtpClient("smtp.myisp.com");
smtpClient.Send("tome@me.com",
"fromyou@you.com",
"Hello Word",
"This is the message");
Also look at the MailMessage class to add more functionality to the send.
You don't need to do anything to web.config.
|
|
|
|
|
I am developing an application in c#,I have to select a file from PC and upload the file details to server.The file details incude filename,filetype,size etc.
In order to find filetype I need to detect MIMEType.
Please anybody help me.
Thanks
|
|
|
|
|
Maybe this[^] is of some help for you.
SkyWalker
|
|
|
|
|
Hello,
I am having few queries related to "reference" and "const" in C#.
1). How to pass a const value by reference.
i.e. in C++
Class Vehicle{};
AnotherClass
{
Vehicle vh;
void SetData(const Vehicle& );
}
How to do it in C#.
2). How to use const member function in C#.
Thanks in advance.
Gajesh
Pune(India)
|
|
|
|
|
C# is crap. You can't do either.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
John Simmons, stop hijaking Christian's account!
led mike
|
|
|
|
|
gajesh wrote: How to pass a const value by reference.
What you are asking for is either very simple or not possible at all, I haven't tried which. You can try it:
const int answer = 42;
SetData(ref answer);
void SetData(ref parameter) { ... }
This will either automatically create a copy of the constant before it's passed to the method, as a constant can not be changed, or it will produce a compilation error, as you have to copy the value yourself.
What it looks like you are trying to do from the code, is to make a constant argument, which is not supported in C#.
gajesh wrote: How to use const member function in C#.
Methods are always constant, you can never change the definition of a method at runtime.
---
Year happy = new Year(2007);
|
|
|
|
|
Guffa wrote: Methods are always constant, you can never change the definition of a method at runtime.
AFAIK C++ const methods are, by definition, methods that can't change the state of the object they belongs.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
or a way to create a string-indexed array of int (sort of the reverse of what most arrays are)... thanks!
|
|
|
|
|
Dictionary is a map. In .NET 2.0, generics means you can specify the type of the two arguments.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Talking about the designers of C# making something complicated or what!
I have built a LogViewer application and my objective is to terminate the application if it determines there are no log files to display or if the logfile is in use by another application.
I run the application from Main as follows:
Application.Run(new MainForm());
In MainForm, it first does InitializeComponent, then it Populates the LogSelector with some user choices and then it adds logging info to the appropriate control if a log file is available (DisplayLogInfo).
If DisplayLogInfo detects that no logfile is available or the logfile is being used by another app, I want LogViewer to not show any form and to terminate.
I have tried this.Hide(). I have tried Application.Exit(). I have tried to make the form invisible by setting this.Visible to false. I have tried this.Dispose(), but then I get an unhandled exception and would rather not handle the exception by ignoring it.
Regardless, the form always displays and I have to close the app via closing the Window by the Close button.
Can anyone suggest a way to get this to work.
I would rather not rewrite the app. so that it checks for the logfile before running InitializeComponent as I believe there must be a way to accomplish the task as I have written it and I would like to learn how it can be done.
Comments?
|
|
|
|
|
Add a handler for MainForm's Load event, and execute this.Close() inside that handler. E.g.:
private void MainForm_Load(object sender, System.EventArgs e)
{
if (LogFileIsNotAvailable)
{
this.Close();
}
}
|
|
|
|
|
I see that your suggestion should work; however, I am still a little puzzled.
Can you tell me the reason why the "this.Hide()" or "this.Close()" did not work when implemented within the MainForm constructor?
|
|
|
|
|
First, I gave you bad (or at least incomplete) advice. I meant to say to use the Application.Idle event rather than the Load event. Calling Close from the Load event can cause a memory leak. You could do something like:
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent(); <br> <br>
if (ShouldClose)
{
Application.Idle += new EventHandler(Application_Idle);
}
} <br> <br>
void Application_Idle(object sender, EventArgs e)
{
this.close();
}
}
The Hide and Close methods don't work in the constructor because the Form is still being constructed. And in any case you don't want to close the form at this point, assuming the calling code looks something like:
Application.Run(new MainForm());
If MainForm is closed and disposed before it is constructed, then Application.Run will throw an ObjectDisposedException.
|
|
|
|
|
Hi!
I want to disable a windows close button.
Instead when the user presses the close button i want the window to hide (and not close) and the tray icon to appear.
The window hiding and the creation of the tray icon part is OK and works. (I tested this by calling those thing when I press a user button inside the form.)
Using FormClosed (occurs after the form is closed not good) and FormClosing(occurs before the form is closed) events doesn't seem to work. Can anyone give a suggestion.
Thanx
|
|
|
|
|
Hi,
Setting e.Cancel=true inside the Closing event handler did it for me (it cancels the
Close action that starts with a Closing event and, if not cancelled, ends with a Closed event.
Luc Pattyn
|
|
|
|
|
Thanx LUC
|
|
|
|
|
Hello!
How to create a application, that is stucked to the desktop? Is there any opposite of "always on top" like "always on bottom"?
Maybe you can help creating apps stucked on the desktop!
Thank you very much.
Metty
|
|
|
|