|
I am developing a Compact Framework app that reads files created by a "legacy" desktop application.
One of the values it must handle originated as a COleDateTime and was written to the file as a double . I can read the double easily enough, but how can I get it into a System.DateTime ?
Thanks in advance for any advice.
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
Convert it using the rules for DATE :
public static DateTime DateTimeFromOADate( double oaDate )
{
DateTime dtOrigin = new DateTime( 1899, 12, 30, 0, 0, 0 );
double absDate = Math.Abs( oaDate );
double intPart = Math.Floor( absDate ) * Math.Sign( oaDate );
double fracPart = absDate - Math.Floor( absDate );
DateTime dtConv = dtOrigin.AddDays( intPart );
dtConv = dtConv.AddDays( fracPart );
return dtConv;
} The bizarre maths comes from the fact that DATE isn't a true number-line: a number's whole part and fractional part are considered separately. The whole part is a number of days relative to 30 December 1899, while the fractional part is always a positive offset to the time within that day (e.g. a fraction of 0.25 always represents 06:00, even if the number is negative).
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Excellent! Thanks.
I just came up with the same thing except for the bizarreness. I think I can do without the bizarreness anyway. The application in question wasn't recording data before 30 Dec 1899!
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
I like to be complete
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Do you need VS. NET to run the Pocket PC 2003 emulator, I have Borland's C# Builder (free) and wanted to try some some programing for it since i dont have a Pocket PC yet.
modified 16-May-21 21:01pm.
|
|
|
|
|
|
yea its what i was afraid of beging a 56k'er. I just read on the help file that came with the SDK and it said something about starting the emulator without eMbedded Visual C++, using the command line, but i guess you need the eMbedded C++ or VS .Net.
modified 16-May-21 21:01pm.
|
|
|
|
|
Can i still run my .Net apps (well .Net compact) with the pocket PC emulator in eMbedded Visual Tools?
modified 16-May-21 21:01pm.
|
|
|
|
|
hi, its me again is there a free tool for developing applications for pocket pc/smart phones the uses the .NEt Compact Framework?
Is the .NET Compact framework SDK available for download?
Can SharpDevelop do mobile applications?
thanks a lot
|
|
|
|
|
Hi,
Can any know how to create, edit and display help when F1 is clicked for each control in VB.NET
Sreepathi.
|
|
|
|
|
Hi, is there any free IDE for VB.NET/C#/.NET Framework, if there is any.........what is the most popular? (aside from web matrix, i need a free tool for windows app)
|
|
|
|
|
Emacs with a C# add in - You'll need to Google for it though.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
|
|
|
|
|
SharpDevelop and the personal edition of Borland C# builder come to mind.
Charlie
if(!curlies){ return; }
|
|
|
|
|
Where is the code that draws the graph? It sounds like the same thing could happen when ever anything else obscured the graph too. Is this the case? (Try placing another window on top of the graph then moving it off again - Do you get the same thing?)
If you put the graph drawing code in the OnPaint() method (you will need to override it from the base class) it should redraw when the window is damaged. If this is not happening then perhaps the date picker needs to notify the graph that it is damaged. In this case you will need to use Refresh() to get the graph to draw itself again.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
|
|
|
|
|
Hi,
I used the following code to know the control which has focus:
System.Windows.Forms.AccessibleObject.GetFocused
The error I got is 'GetFocused' is not a member of 'AccessibleObject', but Documentation says, it is a member.
Do you any one know how to find the focused control.
Thanks,
Sreepathi
|
|
|
|
|
This will return a currently focused control on a form IF the form does not have any container controls on it.
<br />
public Control GetFocused()<br />
{<br />
foreach(Control ctrl in this.Controls)<br />
{<br />
if (ctrl.Focused)<br />
{<br />
return ctrl;<br />
}<br />
}<br />
return null;<br />
}<br />
This is a universal way of getting the currently focused control:
<br />
public class MyForm : Form <br />
<br />
{ <br />
<br />
[DllImport("user32.dll", CharSet=CharSet.Auto, CallingConvention=CallingConvention.Winapi)] <br />
<br />
internal static extern IntPtr GetFocus(); <br />
<br />
<br />
<br />
private Control GetFocusedControl() <br />
<br />
{ <br />
<br />
Control focusedControl = null; <br />
<br />
<br />
IntPtr focusedHandle = GetFocus(); <br />
<br />
if(focusedHandle != IntPtr.Zero) <br />
<br />
<br />
focusedControl = Control.FromHandle(focusedHandle); <br />
<br />
return focusedControl; <br />
<br />
} <br />
<br />
} <br />
|
|
|
|
|
Please, help.
I have a problem: i have few .Net projects. I need to make one multimodule assembly, wich contain this projects as modiles. How can i compile project as module.
PS I can make few assemblies, but i need that my classes in assemblies where friends. (like "internal" in assembly). Can i do it.
PPS Sorry for my english.
Thank you.
sieben
|
|
|
|
|
You can't do it within Visual Studio, but if you build from the command line using csc.exe (C#) or vbc.exe (VB.NET), you can specify /target:module to build a module. By convention, modules have the extension .netmodule .
When building the main assembly, you need to use the /addmodule switch, along with /target:exe, /target:winexe or /target:library depending on whether you're building a console application, a Windows application, or a class library, respectively.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
But if i use csc.exe, a can`t compile whole project, and make module. And if my project consists of many .cs files, i should write names of all this files in command line. Isn`t it?
sieben
|
|
|
|
|
anyone has an idea about the steps to use ngen.exe tool to convert my exe assembly to a native code ???
i read the procedure in the msdn but it's not working with me..
shakooosh
|
|
|
|
|
You cant convert an assembly into 100% native code. NGEN purely takes the JIT compiler and preprocess the assembly so the JIT compiler needs not to be invoked during runtime. Your assembly also needs to be signed for this to work i think.
top secret
|
|
|
|
|
I know the framework supports side-by-side execution, and assume this to mean that if I have two apps that use two different versions of an assembly, each appdomain will load the correct version of the assembly for its host.
Now I have a requirement to process serialized objects, which are serialized from different assembly versions, i.e., I dequeue an object and check which assembly version it was serialized from, and then I need to load the correct version assembly to deserialize the object and call a method on it. The method call will be constant over all versions.
I have started looking at using Assembly.Load to load the correct version assembly, but quickly see inadequacies with this approach. It seems more like I will need to start a separate appdomain for each version as well, and use reflection or remoting to call into the appdomain.
Note that there will not be a very large number of versions, probably around five concurrent versions, so one appdomain per version is not going to be a huge resource problem.
Any comments?
My blog.
|
|
|
|
|
Hello,
how can I change the .NetFramework Version for my project's.
I have installed Version 1.0 and 1.1 on my PC.
thanks in advance
Jörg
|
|
|
|
|
When you use VS.Net 2003, open the property page for your project and choose the entry Supported Runtimes under Common Properties - General.
VS.Net 2002 only supports building applications for the 1.0 Framework, as far as i know.
|
|
|
|
|
Regard!!!
So the question of Transfers to the client an amount of the expected result of functioning WebService (value must be considered on Server side and on the client its has to be seen before that datas will go... ).
I from here try put amount (in bytes) of the message in SoapHeader, which sends by Web service to the client...
On how much I has understood I can get it this way (or I’m wrong… )
public override Stream ChainStream( Stream stream )
{
siz = stream.Length;
return newStream;
}
Here is but afterwards то. шо has got (if has got 8-)) ) Запихиваю in SoapHeader воттак
public override void ProcessMessage(SoapMessage message)
{
if (message.Stage == SoapMessageStage.ХХХХ)
{
((SizeHeader)message.Headers[0]).size=siz;
}
}
So the question is:
What must be is ХХХХ ??? ????
If BeforeSerialize, then - not understandable what happens if I somehow shall else work with stream after serialisation (well for example compress by ZIP and this is the end - an size NOT CORRECT 8-((( )
If AfterSerialize, then before SoapHeader already does not accessible ... 8-(( It already as it were packed... Here is...
Help please... Or prompt other way
In russian...
Привет !!!
Короче ТЗ 8-)))
Задачка передачи клиенту размера ожидаемого результата работы ВебСервиса (цыфра должна быть посчитана на серваке и на клиенте её нада видить до того как пошли данные... ).
Я от тут пытаюсь SoapHeader запихнуть размер (в байтах) сообщения, которое отправляет веб сервис клиенту...
На сколько я понял выхватить его можно примерно вот так (хотя может я и гоню 8-)) )
public override Stream ChainStream( Stream stream )
{
siz = stream.Length;
return newStream;
}
Вот а потом то. шо получил (если получил 8-)) ) Запихиваю в SoapHeader воттак
public override void ProcessMessage(SoapMessage message)
{
if (message.Stage == SoapMessageStage.ХХХХ)
{
((SizeHeader)message.Headers[0]).size=siz;
}
}
Так вот собсно вопрос:
Чему должен быть равен ХХХХ ????
а) Если BeforeSerialize, то тогда - не понятно что произайдёт если я как-то ещё буду работать со stream после сериализации (ну например сожму зипом и все - размер НЕ ТОТ 8-((( )
b) Если AfterSerialize, то тогда до SoapHeader уже не достучаться... 8-(( Он уже как бы упакован... Вот...
Помогите плиз... Или подскажите другой способ
|
|
|
|