BUG: ?????? ??????? .NET Visual C++ ?????? ????? ?????? ?????? ?????? ??? ??? ????? ???? ??????

?????? ????????? ?????? ?????????
???? ???????: 327097 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

???????

???? ?????? ??????? ??????? Visual C++ .NET ?????? ???? NATIVE_TYPE_U1 ? NATIVE_TYPE_VARIANTBOOL ?? ?????? ??? ????? ???? ?? ??? ????? ????? MarshalAs(UnmanagedType::VariantBool).

?????

???? Microsoft ?? ??? ??? ?? Microsoft ???????? ??????? ?? ????? ??? ???????.

??????? ????

????? ????? ????? ?? ????

  1. ?? Visual C++ .NET ? ????? "????? C++ ?????" ????? ??????? ?????? TestBoolean.
  2. ???? ????? ??????? ??? ????? TestBoolean.cpp ?? "?????? ??????" ?? ?? ???????? ????????? ???????? ?? ??? ????? ?? ????????? ???????? ???????:
    // This is the main project file for the Visual C++ Application project that is 
    // generated by using an Application Wizard.
    
    #include "stdafx.h"
    
    #using <mscorlib.dll>
    #include <tchar.h>
    
    using namespace System;
    
    __gc class TestBoolean
    {
    public:
    	[returnvalue:System::Runtime::InteropServices::MarshalAs
    	(System::Runtime::InteropServices::UnmanagedType::VariantBool)]
    	bool RetValBoolean ([System::Runtime::InteropServices::MarshalAs
    	(System::Runtime::InteropServices::UnmanagedType::VariantBool)] bool b)
    	{
    		return b;
    	}
    };
    
    int _tmain(void)
    {
    	TestBoolean *test = new TestBoolean();
    	Console::WriteLine(test->RetValBoolean(true));
    	return 0;
    }
    						
  3. ???? CTRL + SHIFT + B ?????? ???????.
  4. ?? ???? ???????? ???? ?? ???:
    	c:\>ildasm.exe /adv
    						
    ??? ???? ildasm ?? ????? ???????.
  5. ???? TestBoolean.exe ?? ildasm.

  6. ?? ??????? ???? ???? ??? Metalnfo ?? ???? ??? ?????!.

    ??? ?????? ??????? ???? ??? ??????. ????? ?????? ?? ?????? ??????? emits ????? ?? ????? ?????? ?????? ?? ???? ???????.
    Global fields
    -------------------------------------------------------
    
    Global MemberRefs
    -------------------------------------------------------
    
    TypeDef #1
    -------------------------------------------------------
    	TypDefName: TestBoolean  (02000002)
    	Flags     : [NotPublic] [AutoLayout] [Class] [AnsiClass]  (00000000)
    	Extends   : 01000008 [TypeRef] System.Object
    	Method #1 
    	-------------------------------------------------------
    		MethodName: RetValBoolean (06000003)
    		Flags     : [Public] [ReuseSlot]  (00000006)
    		RVA       : 0x00001000
    		ImplFlags : [IL] [Managed]  (00000000)
    		CallCnvntn: [DEFAULT]
    		hasThis 
    		ReturnType: Boolean
    		1 Arguments
    			Argument #1:  Boolean
    		3 Parameters
    			(0) ParamToken : (08000001) Name :  flags: [HasFieldMarshal]  (00002000)
    				NATIVE_TYPE_U1 
    			(0) ParamToken : (08000002) Name :  flags: [HasFieldMarshal]  (00002000)
    				NATIVE_TYPE_VARIANTBOOL 
    			(1) ParamToken : (08000003) Name : b flags: [HasFieldMarshal]  (00002000)
    				NATIVE_TYPE_VARIANTBOOL 
    					

???????

???? ???????: 327097 - ????? ??? ??????: 23/?????/1426 - ??????: 1.6
????? ???
  • Microsoft Visual C++ .NET 2002 Standard Edition
  • Microsoft Visual C++ .NET 2003 Standard Edition
????? ??????: 
kbmt kbhotfixserver kbqfe kbbug kbcominterop kbnofix KB327097 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????327097

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com