???? 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:

  1. ?????? Explorer ???, ?? ?????????????, ????-????? ????AxProject1?? ????-????? ????, ?? ???? ????????.
  2. ?? ?????????????, ????-????? ????Project1?? ????-????? ????, ?? ???? ????????.
  3. ????? ??? ??? ????? ????Project1.TestControl????? ?? ??? ??????? ActiveX ?????????? ???????? ????????

    ????? ?????????? ActiveX ???????? ??? Windows ??????? ??????? ?? ??????AxProject1, ??Project1?? ??????? ????? ???????????? ???UserControlDemo.
  4. ????? ????????????? ??,??????? ??????.

    ???? ??? ?????? ??????? ???? ???
???:??? ?? ?? ?????? ?? ????? ???? ?? ??? ???? ??????? ?? ??? ??? ??????? ActiveX ?????????? ???????? ????? ??AxTestControl2, ?? ??? ?? ?? ?? ???? ?? ??? relates ??? ??? ???? ???????AxTestControl1. ?????? ?? ???, ????? ??? ??? ?? ????? ??, ?? ?? thoughAxTestControl1???? ??????? ?? ?? ??:

Visual Basic .NET ????? ???
Friend WithEvents AxTestControl1 As AxProject1.AxTestControl
????? C# .NET ????? ???
private AxProject1.AxTestControl axTestControl1;
??? ?? ?????AxTestControl1???? ??? ??? elsewhere ?? ?? ??? ???? ?????? ??? ?? ????? ?? ?? ???????? ??AxProject1.AxTestControl????????, ??????? ?? ???? ?? ?? ????
'NullReferenceException'
??????..

Moreover, ??? ???? ??? ?? ?? ???? ????????? ?? ?????????? ActiveX ???????? ?? ?? ???????? ?? ??? ??, ?? ???? ?????? ????? ??? ?? ??????? ???????? ??????? ?? ????

???? 2

  1. ?????? Explorer ???, ?? ?????????????, ????-????? ????AxProject1?? ????-????? ????, ?? ???? ????????.
  2. ?? ?????????????, ????-????? ????Project1?? ????-????? ????, ?? ???? ????????.
  3. Visual Studio .NET ?? Visual Studio 2005 ????? ????????? ?????, ?? ???? ??? ?? ??? ?????????? ?? ??? ?????????? ?? ?????UserControlDemo.
  4. ????? ??????? ???? ????, ?? ???? ??? ?? ??????? ???? ?????? ???????? ?? ?? Windows ??????? ???????? ?????? ??? ?? ??????? ???? ?? ??? Aximp.exe ????? ?? ??? ENTER ????? ?????:

    aximp"FilePath> \Project1.ocx "/out:AxInterop.Project1.dll

    AxInterop.Project1.dll ?? Project1.dll ??? ?????????? ??? ??????? ???? ????

    ???:?????FilePath?????????? ?? ?? ??? ?? Project1.ocx ??? ???
  5. Studio .NET ?? Visual Studio 2005 ????? ?? ????? ????? ????? ????????????????? ??,?????? ??????.
  6. ??????????? ??????????? ????? ????? ???? ??, ?? ????? ???????????.
  7. AxInterop.Project1.dll ?? Project1.dll ?? ?????? ?????, ?? ???? ??? ?????? ?? ??? ?????
  8. ????? ????,??????? ????-????? ????, ?? ???? ???OK?? ???????? ?? ???? ????????? ??? ???????
  9. ??? ????, ?? Windows ??????? ??????? ?? ??? ?? ??????

    Windows ??????? ??? ??????? ActiveX ?????????? ???????? ????? ????????

    ???:???? ?? ?????? ??? ????? ?????? ??????? ActiveX ?????????? ???????? ??? ?? ???AxTestControl1. ?????, ???? ??? ?? ???????? ??? ???
  10. ????? ????????????? ??,??????? ??????.

    ???? ??? ?????? ??????? ???? ???
???:?? ??? ??? ????? ?? ???? ?? ?? "???? ???????" ???? ???????, ????? ????? ?? ??????? ??? ????? ??? ?? ???? ?? ?? ??? ???? ??????????? ?? ???? ??, ???? ????????? ??? ????????

??????

?? ??????? ??????? ?????? ??..

???? ???????

??????? ?? ???: ??????? ???? ?? ??? ???

  1. Visual Basic 6.0 ?????, ?? ?? ??? ActiveX ???????? ????? ??????????
  2. ??? ????? ???, ??? ???????????? ?? ???TestControl.
  3. ????? ????????????? ??,???:, ?? ???? ??? ????? ??? ??????:
    Public Sub Method1()
       MsgBox ("Method 1")
    End Sub
  4. ????? ???????????? ??,????? Project1.ocx?? ????-????? ????, ?? ???? ???OK?????????? ?????????????? ????? ????? ???? ?? ?? ???
  5. Visual Studio .NET ?? Visual Studio 2005 ?????? ?? Windows ????????? ??? ?????UserControlDemoVisual Basic .NET, Visual Basic 2005 ?? Visual C# ?? ????? ???? .NET.
  6. Visual Studio .NET 2003, ????? ?????????/??????? ????? ????? ????????? ????????????? ??..

    Visual Studio .NET 2002, ??? ????? ???????????? ???? ????? ?????????? ????????????? ??..


    Visual Studio.2005, ??? ????? ????????? ????? ????? ????????? ????????????? ??..
  7. ????? ????COM ?????? ????? ????, ?? ???? ??????????.
  8. Project1.ocx (??? 4 ??? ????? ???) ?? ?????? ?????, ?? ?? ??? ?? ??? ?????
  9. ????? ????,??????? ????-????? ????, ?? ???? ???OK????? ?? ???Project1.TestControl???? ?? ??? ??????
  10. ????? ??? ??? ????? ????Project1.TestControl????? ?? ???AxTestControl1???? ?? ??? ????????

    ??????AxProject1, ??Project1?? ??????? ????? ????:???????? ???UserControlDemo.
  11. ????? ????????????? ??,??????? ??????.
  12. ????????? ??????, ?? ???? ??? Visual Studio ?? ???? ?????? .NET ?? Visual Studio 2005?
  13. Visual Basic 6.0 ??? ????, ?? ?? ???? ????????? ?????, ????, ?? ???? ?? ??? ??? ?????TestControl. ?????? ?? ???, ????? ??? ?????TestControl:
    Public Sub Method2()
       MsgBox ("Method 2")
    End Sub
  14. ????? ????????????????? ??,Project1 ???.
  15. ?????Project1 - ????????? ???????? ????? ????? ???? ??, ?? ?? ??? ???? ?? ??? ????? ???????.
  16. ?? ?????????????? ??????, ?? ??? ???? ?? ??? ????? ?????????? ???????? ????-????? ????, ?? ???? ???OK.

    ???:16 ??? ?? ?????? ?? ??? 14 ????? ?? ??? ???? ?? ??? ???? ?????????? ???????????????? ActiveX ???????? recompiling ???? ?? ???? ???????
  17. ????? ???????????? ??,????? Project1.ocx.
  18. ????? ????,????? ???? ??? ??? ?????? ????? ?? ???????????? ???? ?? ????
  19. Visual Studio .NET ?? Visual Studio 2005 ????? ??UserControlDemo.

    ?? ?????TestControl1Windows ??????? ??? ????? ???? ???? ?? ????????
  20. ????? ????????????? ??,??????? ??????.

    ???? "?????" ??? ????????? ?? ???? ?? ????

??????

???????? ??????? ?? ???, Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ?????? ????? ????::
316171  (http://support.microsoft.com/kb/316171/EN-US/ )
???? ??????? ?? ???, ????? MSDN ??? ???? ?? ????:
Microsoft ActiveX ???????? ?? ??????
HTTP://msdn2.Microsoft.com/en-us/library/ms968501.aspx (http://msdn2.microsoft.com/en-us/library/ms968501.aspx)
Windows ??????? ActiveX ???????? ????? (Aximp.exe)
(vs.71) http://msdn2.Microsoft.com/en-us/library/8ccdh774 .aspx (http://msdn2.microsoft.com/en-us/library/8ccdh774(vs.71).aspx)
?????? Callable ????
(vs.71) http://msdn2.Microsoft.com/en-us/library/8bwh56xe .aspx (http://msdn2.microsoft.com/en-us/library/8bwh56xe(vs.71).aspx)
?????? Visual Basic ?????? ????????
(vs.71) http://msdn2.Microsoft.com/en-us/library/a6xdzb3y .aspx (http://msdn2.microsoft.com/en-us/library/a6xdzb3y(vs.71).aspx)


???? ???? ???? ??:
  • 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/ )