|
|
look on Wikipedia[^]
ptr2void wrote: What is UTC time? How is it different from Local Time?
UTC is just like another timezone. It will have a fixed offset from your local time.
ptr2void wrote: Does it mean that UTC time are same on every machine at a particular instant
No, each machine will calculate UTC as an offset from it's local clock. If you need a time value for co-ordination or timestamps you need to use a central server for your clock. If it's an app with a database back end you can just use the database time.
ptr2void wrote: I want to time which should be uniform across the globe. Like different application calling my server should pass universal time so that it is easy to maintain. What time should I be using on clients?
Yes, you should use UTC to pass times between machines, servers, clients and internally, etc. But ideally, you should then convert the UTC to the machines local time zone before you display it to a user. Users won't generally understand what UTC is.
Simon
|
|
|
|
|
|
Thank you very much Simon.
|
|
|
|
|
ptr2void wrote: What is UTC time? How is it different from Local Time?
You needed CP to answer this for you? You couldn't have found this info by using googl.... *checks profile* aaaaaahhh, the sub-continent. Now I understand!
|
|
|
|
|
J4amieC wrote: *checks profile* aaaaaahhh, the sub-continent. Now I understand!
Well, and I thought that the respected MVP's are here to help the beginners and newbies too who are very new to the technology...
Now I get to know what some of their real attitudes !!!
modified on Monday, April 21, 2008 9:51 AM
|
|
|
|
|
ptr2void wrote: Now I get to know what some of their real attitudes !!!
Don't worry about it. It isn't anything personal. It is just that many folks from India have a propensity to ask questions first rather than go and read the documentation first. Think of it as a culture clash. In the west the preferred (polite) route is to do some research first and if that fails to ask questions and be prepared to show that you've done the research.
|
|
|
|
|
Colin Angus Mackay wrote: In the west the preferred (polite) route is to do some research first and if that fails to ask questions and be prepared to show that you've done the research.
West, shmest! In the real world you're expected to use your initiative and to ask sensible questions when you've done a reasonable amount of research for yourself.
|
|
|
|
|
J4amieC wrote: West, shmest! In the real world...
Well, it seems to me that it is mostly folks from the east (and in particular India) that make the mistake of not attempting to do research.
|
|
|
|
|
Its not like that..
I came here only after I had googled the question..
But I came here to have an indepth analysis of my query..
Anyways, I dont think its good to comment on other folks and countries like that..
We all are here to help and get help..
Even if somebody dosent make research, he should be told to do so and not comment on any particular region or nation..
That shows how you respect(or dont) other people..
|
|
|
|
|
Got u Colin..
I took it personally until I saw your post..
But there should be polite ways to answer too..
People shouldnt be commenting on other countries and the attitudes of people, I guess that is regarded RUDE everywhere..
I admit I made research but not that much, will do in future..
|
|
|
|
|
help me!!!i need programm on C# "Maltus' model"!!!
|
|
|
|
|
veronika89 wrote: need programm on C# "Maltus' model"!!!
Well, good luck then. Obviously you'll be wanting to read up on this via Google. We aren't going to write your software for you. BTW - choose a better title; we know it's C#.
|
|
|
|
|
1. Please use a descriptive subject line. Given this is the C# forum, every post could carry the subject of C#.
2. We don't do homework here. On the other hand, if you are stuck at a particular place, we'd be happy to help.
3. Please read the guidelines above.
Cheers,
Vikram.
The hands that help are holier than the lips that pray.
|
|
|
|
|
Please don't tell me that even the model name is wrong... [^].
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
It's not that nobody wants to help you, but you made a wrong post.
- Correct forum --> this was good
- Correct language --> Wrong, please create full sentences and mind spelling errors. You're american, people would think you can write in your own language.
- Give a good, (short), clear description in the subject.
- Tell us what you did yourself to find a solution to the problem
- it proves your not lazy and awaiting an answer while you're watching the television.
- it prevents people from going down a line you already searched.
- It doesn't matter if it's homework, real work or just for fun, just show you did some research yourself
- people will guide you and give a direction, they will not do the task for you.
- some people take the time to actually do research for you, take time to thank them for their effort.
hope this helps.
|
|
|
|
|
Guys,
Check out the following
private void btn_disable_Click(object sender, EventArgs e) {
IntPtr handle = FindWindow(null, "windowtitle");
Form.FromHandle(handle);
IntPtr chandle = GetDlgItem(handle, Convert.ToInt32(txtbox_controlid.Text));
Control.FromHandle(chandle);
string text = "";
GetWindowText(handle, text, 10);
MessageBox.Show(text);
}
[DllImport(@"user32.dll", EntryPoint="GetDlgItem")]
public static extern IntPtr GetDlgItem(IntPtr DialogHandle, int ControlId);
[DllImport(@"user32.dll", EntryPoint="FindWindow")]
public static extern IntPtr FindWindow(string ClassName, string DialogTitle);
[DllImport(@"user32.dll", EntryPoint="GetWindowText")]
public static extern int GetWindowText(IntPtr Hwnd, string text, int length);
both handle as chandle give back an IntPtr different from zero. Yet my MessageBox will stay empty.
If I try to create a Control (Control.FromHandle(chandle); ) I get back a null value.
I did find an article that uses SendMessage to manipulate controls, but I was wondering if I couldn't plug in into the control via a reference or something. (like TextBox.FromHandle(found_handle)). [EDIT]Goal is to get hold of the properties and methods of the control like backColor, ForeColor, GetWindowtext, SetWindowText, Enable, Visible, ...[/EDIT]
Am I on the wrong path here or did I just miss a detail?
thanks !!
|
|
|
|
|
Control.FromHandle(HWND) should return a reference to a Control. For the string to function properly, pass in a StringBuilder.
private void Test() {
IntPtr handle = FindWindow(null, "Form1");
Control c = Control.FromHandle(handle);
StringBuilder text = new StringBuilder();
int x = GetWindowText(handle, text, 10);
MessageBox.Show(x.ToString() + text.ToString() + c.Text);
}
[DllImport(@"user32.dll", EntryPoint = "GetDlgItem")]
public static extern IntPtr GetDlgItem(IntPtr DialogHandle, int ControlId);
[DllImport(@"user32.dll", EntryPoint = "FindWindow")]
public static extern IntPtr FindWindow(string ClassName, string DialogTitle);
[DllImport(@"user32.dll", EntryPoint = "GetWindowText")]
public static extern int GetWindowText(IntPtr Hwnd, StringBuilder text, int length);
Scott
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
Hey,
Thanks for the reply. The StringBuilder option is indeed working, but getting an instance of a Control doesn't seem to work. (it stays null) It could be because the other application is a VC++ application and not .Net ??
thanks.
|
|
|
|
|
You have to make sure that you are looking for the correct window title. The search is done by that parameter, case sensitive. In my example, I left the title to default "Form1", change that to the title of the VC++ window.
Scott P
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
lol, thanks, that is working, but if I take that handle and try to create a Form or Control with the FromHandle method, it will still result in null, although GetWindowText is working.
IntPtr handle = FindWindow(null, "windowtitle");
Form f = Form.FromHandle(handle);
Control c = Control.FromHandle(handle);
string text = "";
GetWindowText(handle, text, 10);
MessageBox.Show(text);
So in this case both f and c are null, but the MessageBox will show my dialogtitle.
My theory is that the code can't convert a Dialog or a Control from a VC++ form/control to a .Net form/control, but I'm not sure about that.
thanks !
(and sorry to be so difficult )
|
|
|
|
|
Hello everybody,
in a DBF Database the strings are written in a given way.
If i read out the strings in C++ i get for the €-Char the Integer-Value -128
In C# i read out the string of the DBase-Table via the ODBC-Connection.
There the Integer-Value is 199 (and does not belong to the €-Char)...
if i convert the character set with Encoding.GetEncoding(858)
i get the right €-Char but has also a integer-value of 8364
How can i convert the values to obtain the -128?
Big thanks in advance !!
|
|
|
|
|
The Euro symbol wasn't part of the original ASCII set, but this[^] page says after installing a patch ASCII 128 becomes the Euro sign.
8364, on the other hand, is the Unicode value for the Euro sign and is safer to use.
Cheers,
Vikram.
The hands that help are holier than the lips that pray.
|
|
|
|
|
Hi master,
I got this error message when initialize matrix with so large number MxN
An unhandled exception of type 'System.StackOverflowException' occurred in [project name].exe
I dont know how to pass this error, anyone can help me please? This is my code:
<br />
class image<br />
{<br />
<br />
<br />
public void zoning()<br />
{<br />
int Max = 0;<br />
for (int i = 1; i < M - 1; i++)<br />
for (int j = 1; j < N - 1; j++)<br />
if (Img_In_Process[i, j] == -1)<br />
{<br />
Max++;<br />
Point_Zone(i, j);<br />
}<br />
}<br />
<br />
private void Point_Zone(int i, int j)<br />
{<br />
Img_In_Process[i, j] = Max;<br />
if ((i - 1 >= 0) && (Img_In_Process[i - 1, j] == -1)) Point_Zone(i - 1, j);<br />
if ((j - 1 >= 0) && (Img_In_Process[i, j - 1] == -1)) Point_Zone(i, j - 1);<br />
if ((i + 1 < M) && (Img_In_Process[i + 1, j] == -1)) Point_Zone(i + 1, j);<br />
if ((j + 1 < N) && (Img_In_Process[i, j + 1] == -1)) Point_Zone(i, j + 1);<br />
}<br />
}
|
|
|
|
|
You are recursively calling Point_Zone too many times and running out of stack space.
Cheers,
Vikram.
The hands that help are holier than the lips that pray.
|
|
|
|
|