Re: COleDateTime::GetCurrentTime() problem
- From: David Lowndes <DavidL@xxxxxxxxxxxxxxx>
- Date: Tue, 24 Oct 2006 22:20:42 +0100
You are right, it has to do with altering floating point processor settings.
Using the flag D3DCREATE_FPU_PRESERVE when creating the Direct3D device
solves the problem.
Searching the newsgroups it appears that others have also suffered
from this problem :(
If you've not done so, I think it'd be worthwhile submitting a bug
report on it (and the solution) to ensure MS are aware of the problem
- and so they can come up with some solution in the future, even if
that's only documenting the fact that something as innocuous as
COleDateTime::GetCurrentTime() can fail because of the floating point
settings.
FWIW, I can now repro the problem with this simple test:
#include "stdafx.h"
#include <ATLComTime.h>
#include <float.h>
int _tmain(int argc, _TCHAR* argv[])
{
unsigned int cw;
_controlfp_s( &cw, _PC_24, _MCW_PC );
const COleDateTime dtNow = COleDateTime::GetCurrentTime();
if ( dtNow.m_status == COleDateTime::invalid )
{
return 1;
}
return 0;
}
Dave
.
- Follow-Ups:
- Re: COleDateTime::GetCurrentTime() problem
- From: David Lowndes
- Re: COleDateTime::GetCurrentTime() problem
- References:
- COleDateTime::GetCurrentTime() problem
- From: Alexander Mair
- Re: COleDateTime::GetCurrentTime() problem
- From: David Lowndes
- Re: COleDateTime::GetCurrentTime() problem
- From: Alexander Mair
- Re: COleDateTime::GetCurrentTime() problem
- From: David Lowndes
- Re: COleDateTime::GetCurrentTime() problem
- From: Alexander Mair
- Re: COleDateTime::GetCurrentTime() problem
- From: Alexander Mair
- Re: COleDateTime::GetCurrentTime() problem
- From: David Lowndes
- Re: COleDateTime::GetCurrentTime() problem
- From: Alexander Mair
- COleDateTime::GetCurrentTime() problem
- Prev by Date: Re: Bitmap and Picture Control ???
- Next by Date: Re: Parent window cannot receive mouse click from child control.
- Previous by thread: Re: COleDateTime::GetCurrentTime() problem
- Next by thread: Re: COleDateTime::GetCurrentTime() problem
- Index(es):
Relevant Pages
|