Brandon said:
*Ben Schwehn said:
Second, when trying to compile a .net project (e.g a brand ne .net
console or library project) that has <windows.h> included i ge many
linker errors like the one below:
MSVCMRTD.lib(mstartup.obj) : error LNK2022: metadata operatio failed
(80131195) : Custom attributes are not consistent: (0x0c000002).
[...]
LINK : fatal error LNK1255: link failed because of metadata errors
Any idea how to fix this?
It took a little bit to track this down, but we did it. This i
caused
because we moved the NativeEnumAttribute from Microsoft.VisualC.dl
to
another assembly. The managed CRT has a few enums (probably fro
windows.h)
that have the old location, while your code has the new location. (I
personally think the Attribute shouldn't even be there).
Anyways, this is fixed by building with a newer msvcmrt.lib o
msvcmrtd.lib.
We will package that and provide it with the next refresh. We'll tr
to get
that done next week.
I'm sorry for the inconvenience.
--
Brandon Bray, Visual C++ Compiler
http://blogs.msdn.com/branbray/
This posting is provided AS IS with no warranties, and confers n
rights. *
I am wanting to use Windows Forms with MFC but was disappointed wit
Visual Studio 2005 Beta. My heart rejoiced when I found out that ther
was a tools refresh. So, I immediate tried to get my existing projec
to work with it. Since then I have had 2 problems, one in release an
the other in the debug build.
In the release build, I received numerous errors stating that th
CWinFormsEventsHelper class does not have a get_Control() method.
fixed this by changing 'afxwinforms.inl'. The changes are below wit
the original commented out and the revisions just below it.
_AFXWIN_INLINE System::Windows::Forms::Control^
CWinFormsControlSite::get_Control() const
{
//System::Windows::Forms::Control
pControl=m_gcEventHelper->get_Control();
//ENSURE((CWinFormsEventsHelper^)m_gcEventHelper!=nullptr &
pControl!=nullptr);
//return pControl;
ENSURE((CWinFormsEventsHelper^)m_gcEventHelper!=nullptr);
System::Windows::Forms::Control^ pControl=m_gcEventHelper->Control;
ENSURE(pControl!=nullptr);
return pControl;
}
When I made these corrections and re-compiled. My release buil
generated the same errors as found in my debug build. They are a
follows:
101 instances of:
MSVCMRT.lib(mstartup.obj) : error LNK2022: metadata operation faile
(80131195) : Custom attributes are not consistent: (0x0c000002).
Followed by one instance of:
LINK : fatal error LNK1255: link failed because of metadata errors
I am thankful that someone else have already found this error, that yo
have diagnosed it and have committed to fixing it in one week (as o
August 28). My questions are as follows:
1) Where will the fix be made available so that I won't b
re-downloading the original Tools Refresh?
2) Will it still be out this week? [Today is September 1]
3) Was it ok to make the change to the 'afxwinforms.inl' file so tha
my release build will generate the same error as the debug? Will tha
be in the Update or will I need to make that change again
-
jwaterlo