|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ambiguous data typesHi,
Under VC++.net, if i include windows.h, and compile my application, i have several data types ambiguous, like IDataObject, IMessageFilter, IDropTarget,... so it means that they are defined in windows.h but also in some other namespaces. how can i do to still have my windows.h included and avoiding ambiguous definition ? and thus without undefining all ambiguous data type ? thx. Alain --== Alain ==-- wrote:
> Hi, You're going to have to show some minimal amount of code to reproduce the > > Under VC++.net, if i include windows.h, and compile my application, i > have several data types ambiguous, like IDataObject, IMessageFilter, > IDropTarget,... > > so it means that they are defined in windows.h but also in some other > namespaces. > > how can i do to still have my windows.h included and avoiding > ambiguous definition ? and thus without undefining all ambiguous data > type ? problem that you're seeing. Generally, I think the experience is better if you do NOT include windows.h in modules that are compiled with /clr - keep it limited to purely native modules. -cd Here is the ARDLLWrapper.h file that i include in my main.h file
When i compile this file with its relative *.cpp, it's ok, but when i try to compile my application. It generates the error i meant before. it seems that it is known problem, but i did not find the solution on internet for now. do you have an idea ? //--- ARDLLWrapper.h -- #include <windows.h> using namespace System; using namespace System::Runtime::InteropServices; //--------------------------------------------------------------------------- #ifndef CARDLLWrapperH #define CARDLLWrapperH //------------------------------------------------------------------------------ public ref class CARDLLWrapper { private: public: CARDLLWrapper(); ~CARDLLWrapper(); [DllImportAttribute(L"frmwrk_lc.dll", CallingConvention=CallingConvention::ThisCall, CharSet = CharSet::Auto, EntryPoint = L"DLL_GetString")] static LPTSTR DLL_GetString(HMODULE hwnd_DLL, long Index); bool InitLocalization(LPTSTR dll_name); LPTSTR STR(long Index); }; //--------------------------------------------------------------------------- #endif Carl Daniel [VC++ MVP] wrote: Show quote > --== Alain ==-- wrote: >> Hi, >> >> Under VC++.net, if i include windows.h, and compile my application, i >> have several data types ambiguous, like IDataObject, IMessageFilter, >> IDropTarget,... >> >> so it means that they are defined in windows.h but also in some other >> namespaces. >> >> how can i do to still have my windows.h included and avoiding >> ambiguous definition ? and thus without undefining all ambiguous data >> type ? > > You're going to have to show some minimal amount of code to reproduce the > problem that you're seeing. > > Generally, I think the experience is better if you do NOT include windows.h > in modules that are compiled with /clr - keep it limited to purely native > modules. > > -cd > > |
|||||||||||||||||||||||