Re: COleDateTime::GetCurrentTime() problem



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
.



Relevant Pages

  • Re: COleDateTime::GetCurrentTime() problem
    ... Using the flag D3DCREATE_FPU_PRESERVE when creating the Direct3D device ... Searching the newsgroups it appears that others have also suffered ... In the absence of an obvious bug report by the OP on the connect site, ...
    (microsoft.public.vc.mfc)
  • Dataset Multi-Table Row changes
    ... After quite a bit of searching through the newsgroups I have been able ... to fill a dataset with two tables using two separate datadapters. ... What I need to do now is to update the records in table1 based on the ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Search function in this discussion group
    ... I can see at least 3 posts with "password" in their title. ... What is the secret to searching on Microsoft.com ... set up a newsreader instead (very easy to ... information about newsgroups: ...
    (microsoft.public.windowsxp.general)
  • Re: Question about offering solutions here (head up, MVPs!)
    ... It always amazes me that people can find newsgroups but not find Help. ... I think that people think of searching Help as searching through an ... Windows there is a lot of computer terminology that people are just plain ...
    (microsoft.public.windowsxp.general)
  • Re: help understanding authentication on workgroups
    ... In all my searching I didn't end up seeing the links you provided. ... I just wanted you to know that this isn't a "forum" and there ... some links to information about newsgroups: ... Using Outlook Express as Newsreader: ...
    (microsoft.public.windowsxp.network_web)

Quantcast