I made a second form but whenever i try to put it in my project i get lots of errors.
I am just puting :

#include "Picture_viewer.h

but i am getting list of errors :

1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5934) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(251) : System::Windows::Forms::IDataObject IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5934) : error C3699: '*' : cannot use this indirection on type 'IDataObject'
1> compiler replacing '*' with '^' to continue parsing
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : error C2371: 'IDataObject' : redefinition; different basic types
1> C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(251) : see declaration of 'IDataObject'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(6110) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(6123) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(6136) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(6171) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(6184) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(6282) : error C2872: 'IMessageFilter' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(263) : System::Windows::Forms::IMessageFilter IMessageFilter'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IMessageFilter'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(6282) : error C3699: '*' : cannot use this indirection on type 'IMessageFilter'
1> compiler replacing '*' with '^' to continue parsing
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(6328) : error C2371: 'IMessageFilter' : redefinition; different basic types
1> C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(263) : see declaration of 'IMessageFilter'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(12671) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(12677) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(12682) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(12688) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(12693) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(12700) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>c:\program files\microsoft sdks\windows\v6.0a\include\oleidl.h(374) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>c:\program files\microsoft sdks\windows\v6.0a\include\oleidl.h(1151) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>c:\program files\microsoft sdks\windows\v6.0a\include\oleidl.h(1157) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>c:\program files\microsoft sdks\windows\v6.0a\include\oleidl.h(3288) : error C2872: 'IDropTarget' : ambiguous symbol
1> could be 'c:\program files\microsoft sdks\windows\v6.0a\include\oleidl.h(173) : System::Windows::Forms::IDropTarget IDropTarget'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDropTarget'
1>c:\program files\microsoft sdks\windows\v6.0a\include\oleidl.h(3288) : error C3699: '*' : cannot use this indirection on type 'IDropTarget'
1> compiler replacing '*' with '^' to continue parsing
1>c:\program files\microsoft sdks\windows\v6.0a\include\oleidl.h(3328) : error C2371: 'IDropTarget' : redefinition; different basic types
1> c:\program files\microsoft sdks\windows\v6.0a\include\oleidl.h(173) : see declaration of 'IDropTarget'
1>c:\program files\microsoft sdks\windows\v6.0a\include\oleidl.h(3332) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>c:\program files\microsoft sdks\windows\v6.0a\include\oleidl.h(3345) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(96) : error C2872: 'IServiceProvider' : ambiguous symbol
1> could be 'c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(53) : System::IServiceProvider IServiceProvider'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : System::IServiceProvider'
1>c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(96) : error C3699: '*' : cannot use this indirection on type 'IServiceProvider'
1> compiler replacing '*' with '^' to continue parsing
1>c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(103) : error C2371: 'IServiceProvider' : redefinition; different basic types
1> c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(53) : see declaration of 'IServiceProvider'
1>c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(120) : error C2872: 'IServiceProvider' : ambiguous symbol
1> could be 'c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(103) : IServiceProvider'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : System::IServiceProvider'
1>c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(235) : error C2872: 'IServiceProvider' : ambiguous symbol
1> could be 'c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(103) : IServiceProvider'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : System::IServiceProvider'
1>c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(242) : error C2872: 'IServiceProvider' : ambiguous symbol
1> could be 'c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(103) : IServiceProvider'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : System::IServiceProvider'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\urlmon.h(5854) : error C2872: 'IServiceProvider' : ambiguous symbol
1> could be 'c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(103) : IServiceProvider'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : System::IServiceProvider'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\urlmon.h(5856) : error C2872: 'IServiceProvider' : ambiguous symbol
1> could be 'c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(103) : IServiceProvider'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : System::IServiceProvider'

but as soon as i remove the include all the errors go away, so how would i add a second form in my application?
Thanks in advanced.

I am using the default compiler visual c++ comes with

what version of VC++?

My guess is that you are writing a CLI/C++ program and Picture_viewer.h is using some unmanaged code. Here are some links that discuss that topic.

Edited 6 Years Ago by Ancient Dragon: n/a

i am using visual c++ 2008 and both are managed code(CLI)

I readed some of the links you posted but i am not trying to combine managed and unmanaged code.

I went to : project->add new item->forms

i made my form but now i want to include it in my first form so i can show it.

I've done that with VC++ 2010 Express and never had a problem. For some reason your compiler is attempting to get something from Microsoft Windows SDK that is installed on your computer.

I figure the problem out, i was including my form2.h at the top before windows.h, and other includes.

This article has been dead for over six months. Start a new discussion instead.