???? ID: 818220 - ????? ???????: 05 ?????? 2010 - ??????: 3.0
?????????? ActiveX ???????? ??????? ??????? ??? ?????? ???? ?? ?? ?? ???? ?????? ????????? ?? ?????
?????? ?????? This article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.
?? ?? Visual Studio .NET ?? Visual Studio 2005 ??? ??? ?????? Windows ????????? ?? ???: ?????, ???? ???????? ActiveX ?????????? ???????? ???? ?? ???? ?? Windows ??????? ??????? ??? ??? ??? ??? ??? ??, ?? ?? ????????? ?? ?????? ???? ?? ?????? ????, ???? ??????? ?? ???? ?? ????? ?? ???? ??????:
?????? 'AxProject1.AxTestControl' ????????? ???? ???
???????? ??? 'AxProject1' ???? ????? ?? ???? ??? .NET ??????? ???? ?????? ?????? ????????? ?? ??? 'Project1' ???? ????? ?? ????
?? ?? Visual Studio .NET ?? Visual Studio 2005 ????????? ?? ??? ?????????? ActiveX ???????? ?? ?????? ???, ?? Visual Studio .NET ?? Visual Studio 2005 internally ??????? ??????? ActiveX ???????? ????? Windows ????? (Aximp.exe)? Aximp.exe ?????? ????????? ??? ?????? ???? ?? ActiveX ?? ?????????? ????????, ?? ??? ????? ????? ?? ??????:
?? ??????? ???? ?????? ???????? COM ???????? ?? ???? ???? Windows ??????? ???????? ?????????? ActiveX ???????? ?? ???? ?? ?? ???????? ??????? ?? ??????? ActiveX ?????????? ???????? ???? ?? ??? relates ??????? ???
?????? ActiveX ?????????? ????????, ???? ??? ?????, ???? ?? ??? ?? ????????? ????? ?????, ?? ???? ??? ?? ?????????? ActiveX ???????? recompile, ?? ?? ?? ???? ????????? ????? ?????????? ActiveX ???????? ?? ??????? ?? ????? ???? ???? ???????, ??????? ???? ?????? ???????? ????? ?? ?? ??????? ?? ??? ?????? ???? ??? ?????, ActiveX ???????? ?? ?????????? Windows ??????? ??????? ??? ??? ??? ?? ????? ???? ??, ???????? ???? ?? ??????? Windows ??????? ?????? ?? ??, ?? ?? ???? ?? "?????" ??? ??? discussed ??????? ????? ???? ???
???: ????? ????
??? ????? ????? ?? ?????????, ???? ????? ?? ????
??? ???, ?? ???? ??? ?? ??? ????
?????? ?????? ???? ???? ?? ?? recompile Microsoft Visual Basic 6.0 ??? ?????? ActiveX ?????????? ???????? ??????? ?? ?????? ???, ?????? ??????? ???? ?????? ???????? ?????? ??, Windows ??????? ???????? ???? ?????? ??? ?? ?? ?? ??????? ??? ?????? ???
?? ?????? ?? ?? ???? ?????????? ActiveX ???????? ?? ?????? ?????? ???????, ?? ?? ??? ?? ?????? ?????? ??????? ??? ???? ?? ???, ????? ??????? ??? ?? ???? ?? ?? ?????
?????? 1: ?????? Explorer ???, ?? ????????????? , ????-????? ????AxProject1 ?? ????-????? ????, ?? ???? ???????? . ?? ????????????? , ????-????? ????Project1 ?? ????-????? ????, ?? ???? ???????? . ????? ??? ??? ????? ????Project1.TestControl ????? ?? ??? ??????? ActiveX ?????????? ???????? ???????? ????? ?????????? ActiveX ???????? ??? Windows ??????? ??????? ?? ??????AxProject1 , ??Project1 ?? ??????? ????? ?????????? ?? ???UserControlDemo . ????? ????????? ???? ??,??????? ?????? . ???? ??? ?????? ??????? ???? ??? ???: ??? ?? ?? ?????? ?? ????? ???? ?? ??? ???? ??????? ?? ??? ??? ??????? ActiveX ?????????? ???????? ????? ??
AxTestControl2 , ?? ??? ?? ?? ?? ???? ?? ??? relates ??? ??? ???? ???????
AxTestControl1 . ?????? ?? ???, ????? ??? ??? ?? ????? ??, ?? ?? though
AxTestControl1 ???? ??????? ?? ?? ??:
Visual Basic .NET ????? ??? Friend WithEvents AxTestControl1 As AxProject1.AxTestControl ????? C# .NET ????? ??? private AxProject1.AxTestControl axTestControl1; ??? ?? ?????
AxTestControl1 ???? ??? ??? elsewhere ?? ?? ??? ???? ?????? ??? ?? ????? ?? ?? ???????? ??
AxProject1.AxTestControl ????????, ??????? ?? ???? ?? ?? ????
'NullReferenceException'
??????..
Moreover, ??? ???? ??? ?? ?? ???? ????????? ?? ?????????? ActiveX ???????? ?? ?? ???????? ?? ??? ??, ?? ???? ?????? ????? ??? ?? ??????? ???????? ??????? ?? ????
???? 2 ?????? Explorer ???, ?? ????????????? , ????-????? ????AxProject1 ?? ????-????? ????, ?? ???? ???????? . ?? ????????????? , ????-????? ????Project1 ?? ????-????? ????, ?? ???? ???????? . Visual Studio .NET ?? Visual Studio 2005 ????? ????????? ?????, ?? ???? ??? ?? ??? ?????????? ?? ??? ?????????? ?? ?????UserControlDemo . ????? ??????? ???? ????, ?? ???? ??? ?? ??????? ???? ?????? ???????? ?? ?? Windows ??????? ???????? ?????? ??? ?? ??????? ???? ?? ??? Aximp.exe ????? ?? ??? ENTER ????? ?????:aximp"FilePath > \Project1.ocx "/out:AxInterop.Project1.dll AxInterop.Project1.dll ?? Project1.dll ??? ?????????? ??? ??????? ???? ???????: ?????FilePath ?????????? ?? ?? ??? ?? Project1.ocx ??? ??? Studio .NET ?? Visual Studio 2005 ????? ?? ????? ????? ????? ????????????? ???? ??,?????? ?????? . ??????????? ?????? ????? ????? ????? ???? ??, ?? ????? ??????????? . AxInterop.Project1.dll ?? Project1.dll ?? ?????? ?????, ?? ???? ??? ?????? ?? ??? ????? ????? ????,????? ?? ????-????? ????, ?? ???? ???OK ?? ???????? ?? ???? ????????? ??? ??????? ??? ????, ?? Windows ??????? ??????? ?? ??? ?? ?????? Windows ??????? ??? ??????? ActiveX ?????????? ???????? ????? ???????????: ???? ?? ?????? ??? ????? ?????? ??????? ActiveX ?????????? ???????? ??? ?? ???AxTestControl1 . ?????, ???? ??? ?? ???????? ??? ??? ????? ????????? ???? ??,??????? ?????? . ???? ??? ?????? ??????? ???? ??? ???: ?? ??? ??? ????? ?? ???? ?? ?? "???? ???????" ???? ???????, ????? ????? ?? ??????? ??? ????? ??? ?? ???? ?? ?? ??? ???? ??????????? ?? ???? ??, ???? ????????? ??? ????????
?? ??????? ??????? ?????? ??..
??????? ?? ???: ??????? ???? ?? ??? ??? Visual Basic 6.0 ?????, ?? ?? ??? ActiveX ???????? ????? ?????????? ??? ????? ???, ??? ???????? ???? ?? ???TestControl . ????? ????????? ???? ??,???: , ?? ???? ??? ????? ??? ??????:Public Sub Method1()
MsgBox ("Method 1")
End Sub ????? ???????? ???? ??,????? Project1.ocx ?? ????-????? ????, ?? ???? ???OK ?????????? ????????? ????? ????? ????? ???? ?? ?? ??? Visual Studio .NET ?? Visual Studio 2005 ?????? ?? Windows ????????? ??? ?????UserControlDemo Visual Basic .NET, Visual Basic 2005 ?? Visual C# ?? ????? ???? .NET. Visual Studio .NET 2003, ????? ?????????/??????? ????? ????? ???? ????? ????????? ???? ??.. Visual Studio .NET 2002, ??? ????? ???????????? ???? ????? ????? ????? ????????? ???? ??.. Visual Studio.2005, ??? ????? ????????? ????? ????? ???? ????? ????????? ???? ??.. ????? ????COM ??? ??? ????? ????, ?? ???? ?????????? . Project1.ocx (??? 4 ??? ????? ???) ?? ?????? ?????, ?? ?? ??? ?? ??? ????? ????? ????,????? ?? ????-????? ????, ?? ???? ???OK ????? ?? ???Project1.TestControl ???? ?? ??? ?????? ????? ??? ??? ????? ????Project1.TestControl ????? ?? ???AxTestControl1 ???? ?? ??? ???????? ??????AxProject1 , ??Project1 ?? ??????? ????? ????:?????? ?? ???UserControlDemo . ????? ????????? ???? ??,??????? ?????? . ????????? ??????, ?? ???? ??? Visual Studio ?? ???? ?????? .NET ?? Visual Studio 2005? Visual Basic 6.0 ??? ????, ?? ?? ???? ????????? ?????, ????, ?? ???? ?? ??? ??? ?????TestControl . ?????? ?? ???, ????? ??? ?????TestControl :Public Sub Method2()
MsgBox ("Method 2")
End Sub ????? ????????????? ???? ??,Project1 ??? . ?????Project1 - ????????? ??? ????? ????? ????? ???? ??, ?? ?? ??? ???? ?? ??? ????? ??????? . ?? ?????????????? ?????? , ?? ??? ???? ?? ??? ????? ?????????? ?????? ?? ????-????? ????, ?? ???? ???OK .???: 16 ??? ?? ?????? ?? ??? 14 ????? ?? ??? ???? ?? ??? ???? ?????????? ?????? ?????????? ActiveX ???????? recompiling ???? ?? ???? ??????? ????? ???????? ???? ??,????? Project1.ocx . ????? ????,??? ?? ???? ??? ??? ?????? ????? ?? ???????????? ???? ?? ???? Visual Studio .NET ?? Visual Studio 2005 ????? ??UserControlDemo . ?? ?????TestControl1 Windows ??????? ??? ????? ???? ???? ?? ???????? ????? ????????? ???? ??,??????? ?????? . ???? "?????" ??? ????????? ?? ???? ?? ???? ???????? ??????? ?? ???, Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ?????? ????? ????::
316171
(http://support.microsoft.com/kb/316171/EN-US/
)
???? ??????? ?? ???, ????? MSDN ??? ???? ?? ????:
???? ???? ???? ??: Microsoft .NET Framework 1.1 Microsoft .NET Framework 1.0 Microsoft Visual Studio .NET 2003 Academic Edition Microsoft Visual Studio .NET 2003 Enterprise Architect Microsoft Visual Studio .NET 2003 Enterprise Developer Microsoft Visual Studio .NET 2003 Professional Edition Microsoft Visual Studio .NET 2002 Academic Edition Microsoft Visual Studio .NET 2002 Enterprise Architect Microsoft Visual Studio .NET 2002 Enterprise Developer Microsoft Visual Studio .NET 2002 Professional Edition Microsoft Visual Basic 2005 Microsoft Visual Basic .NET 2003 Standard Edition Microsoft Visual Basic .NET 2002 Standard Edition Microsoft Visual C# .NET 2003 Standard Edition Microsoft Visual C# .NET 2002 Standard Edition Microsoft .NET Framework 2.0 kbvs2005swept kbvs2005applies kbideproject kbide kbcomctrls kbctrlcreate kbctrl kbcontrol kbcominterop kbprb kbmt KB818220 KbMthi
???? ?????? ???????? ??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:
818220
(http://support.microsoft.com/kb/818220/en-us/
)
?? ??????? ?? ??????????? ???
???? ?? ??????? ?? ???? ?????? ?? ?? ?????
???? ?? ??????? ??????? ???
???? ?? ???? ?? ????? ???? ?? ??? ????????? ??? ?? ????? ?????? ?????
?? ??????? ?? ????? ???? ?? ??? ?? ???? ?? ???? ????
???? ???????? ?? ????? ?? ???, ???? ??????????? ??? ?????? ??????? ????? ? ????.
???????! ????? ?????? ??????? ?? ????? ??? ??? ?? ??? ???? ??????????? ?? ????? ???? ???? ??. ???? ?????? ???????? ?? ???, ?????
??? ?? ?????? ??? ????? ?? ????.
???? ?????? ???? ?????? ??????
??????
??? ?????? ??????? ????
???? ??????