Using a DateTime in a Windows Console DLL

Hi All,

I'm relatively new to C++ & Windows specific programming but quite an experienced programmer in various other languages.

I'm trying to write a Win32 DLL for use by a third party piece of software. I am trying to use DateTime structures within that DLL. When I use 'DateTime' I get the 'undeclared indentifier' from Visual Studio 2008. For example, the following line returns the error...

DateTime TestVar = DateTime(2009, 01, 30);

I have done a lot of googling on this and I am starting to get the feeling that the DateTime structure is actually part of .NET and cannot be used as such in Win32 DLL's...

Basically I'm confused. Am I missing something really simple here...? Is it possible to use the DateTime structure in a Win32 DLL and if so, how...?

Thanks in advance.

Sid
Last edited on
DataTime probably doesn't exist. There's an OleDateTime class, and MFC provides CTime class, but if you're just using the Platform SDK, you might want to consider using the SYSTEMTIME struct with GetSystemTime/GetLocalTime.

The C runtime library has a set of time manipulation functions too.
Yea, I agree with kbw. Check out SYSTEMTIME. There shouldn't be any problem doing what you specified you wanted to do. You'll have to export your functions from the dll though.
Topic archived. No new replies allowed.