New Time-Date ProblmsVC7 (VC++.NET)

COleDateTime t = COleDateTime::GetCurrentTime();

CString str = t.Format(_T("%A, %B %d, %Y"));

m_edit.SetWindowText(str);

Hi, when i first tried the above code on a new empty project, it worked without any problems.(after including the ATLComTime.h)
But i finally modify and use it in my intended solution and i have 4 errors and 4 warnings:

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(246) : warning C4935: assembly access specifier modified from 'public'

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(258) : warning C4935: assembly access specifier modified from 'public'

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(7408) : error C2872: 'IDataObject' : ambiguous symbol
could be 'C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(246) : System::Windows::Forms::IDataObject IDataObject'
or 'stdafx.cpp(0) : System::Windows::Forms::IDataObject'

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(7422) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Form1.cpp

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(246) : warning C4935: assembly access specifier modified from 'public'

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(258) : warning C4935: assembly access specifier modified from 'public'

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(7408) : error C2872: 'IDataObject' : ambiguous symbol
could be 'C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(246) : System::Windows::Forms::IDataObject IDataObject'
or 'stdafx.cpp(0) : System::Windows::Forms::IDataObject'

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(7422) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Generating Code...

Can you figure out what I might nid to do? Tks
[2354 byte] By [luhfluh] at [2007-11-19 19:44:22]
# 1 Re: New Time-Date ProblmsVC7 (VC++.NET)
Have you put that code in a managed application?
cilu at 2007-11-10 23:43:05 >
# 2 Re: New Time-Date ProblmsVC7 (VC++.NET)
Have you put that code in a managed application?

The answer to the quoted question is no, the application is designed from scratch(windows forms project, not MFC).
luhfluh at 2007-11-10 23:43:59 >
# 3 Re: New Time-Date ProblmsVC7 (VC++.NET)
The answer to the quoted question is no, the application is designed from scratch(windows forms project, not MFC).
And how do you explain the warnings related to assembly,

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(246) : warning C4935: assembly access specifier modified from 'public'

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(258) : warning C4935: assembly access specifier modified from 'public'

and the error about System::Windows::Forms::IDataObject

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(7408) : error C2872: 'IDataObject' : ambiguous symbol
could be 'C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(246) : System::Windows::Forms::IDataObject IDataObject'
or 'stdafx.cpp(0) : System::Windows::Forms::IDataObject'

So, let me ask again? Is this a managed application?
cilu at 2007-11-10 23:44:58 >
# 4 Re: New Time-Date ProblmsVC7 (VC++.NET)
The answer to the quoted question is no, the application is designed from scratch(windows forms project, not MFC).
Apparently, the answer is "Yes". Look at the text under the list controls...
VladimirF at 2007-11-10 23:46:00 >
# 5 Re: New Time-Date ProblmsVC7 (VC++.NET)
(windows forms project, not MFC).
Ah, I missed that first time. You know, a windows forms application is a managed application. You write in Managed C++, not C++.

Problem is that IDataObject can be resolved to two declarations, and the compiler doesn't know which one to use.
cilu at 2007-11-10 23:46:59 >
# 6 Re: New Time-Date ProblmsVC7 (VC++.NET)
Thank you for ur time. As you expalined, the compiler doesnt know which of the IDataObject to use. But this problem occured as I added the "ATLComTime.h" header to my project in order to take advantage of timedate display. So is ther any other way?
luhfluh at 2007-11-10 23:48:09 >