Managed C++ wtypes.h DATE 转化为 .net的 DateTime

来源:互联网 发布:安庆网络广播电视电话 编辑:程序博客网 时间:2024/05/22 14:50

http://stackoverflow.com/questions/570224/how-do-i-convert-from-mfcs-coledatetime-to-c-sharp-datetime


在转化C++到 .net 时遇到这个问题 , 


原来是使用 COleDateTime(DATE) 的 

但是我需要的是DateTime

其实DateTime有一个static函数叫:

FromOADate

所以只需要这么做:

DateTime clidatetime = DateTime::FromOADate( DATE );


DATE 类型在 wtypes.h中是这么定义的:

typedef double DATE;

原创粉丝点击