????? ????? ?????? ?? Windows XP ??? ??????? ???????? ?? COM Office

?????? ????????? ?????? ?????????
???? ???????: 830033 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

??? ????? ????? ???????? COM ?????? ??? ?????? Microsoft Office (??? ???? ??????? Microsoft Visio) ? ???? ???? ??????? ???????? ??? ?????? ???? ??????? ??? ???? Office ????????. ??? ???? ?? Microsoft Windows XP, ????? ?????? ?? ??? ?? ??????? ??????? (?? ??????) ?????? ???? ?????? Microsoft Windows.

??? ??? ?? ????? ???? Windows ???? ???? ?? ????? ???????? COM ?? ???? ???? ?????? ??????? ???????? ?? ????? ??????? ??? ??????? ??????? ???????? ???? ?????? ?? ???? - ?? - ?????? ?? ???????? ??? ???????. ????? ????? COM ????? ?? ?? Microsoft Visual C++ ?? ?????? Microsoft Visual Studio .NET ??????? ???????? ????? ?????? ??? Windows.

??? ????? ????? ?????? ???????? Windows ???? ?????? ??? ?????? ??????? ????????. ?? ????? ????? ??????? ????????.

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

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

Microsoft Visual Basic 6.0

?? ????? Visual Basic 6.0 ??????. ?? ???? ????? ??? ??????? ???????? ???????? Visual Basic 6.0.

Microsoft Visual C++ 6.0

???????? 6.0 Visual C++ ?????? ??? ????? ???????? COM ????? ??? Windows XP ????? ???? ??????? ???????:
  1. ????? ??? ???? ???? ????? ??? ????????? ???????. Customize the information for your specific add-in:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
     <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> 
      <noInherit/>
      <assemblyIdentity 
       processorArchitecture="*" 
       type="win32" 
       name="MyOfficeNetAddin"
       version="1.0.0.0"/>
       <description>My Office Addin built with .Net</description> 
       <dependency optional="yes">                              
        <dependentAssembly>                   
         <assemblyIdentity                 
          type="win32"                
          name="Microsoft.Windows.Common-Controls" 
          version="6.0.1.0"           
          publicKeyToken="6595b64144ccf1df" 
          language="*"                
          processorArchitecture="*"/>
        </dependentAssembly>                  
       </dependency>                             
     </assembly>
    
  2. ?? ???? ????????? ???????:
    • ????? ??????? preprocessor ???????:
      #define ISOLATION_AWARE_ENABLED
      
    • ????? ??:
      /D ISOLATION_AWARE_ENABLED
      
  3. ????? ??? ???? ??? ??? ??????, ??? ?? ?????? ??????:
    #include "windows.h"
    ISOLATIONAWARE_MANIFEST_RESOURCE_ID RT_MANIFEST "mydllname.dl.manifest"
    

Microsoft Visual Studio .NET ????? ?????

???????? Visual Studio .NET .NET Framework ????? Windows XP ?????? ?????? ????? ???????? COM ? ???? ??????? ???????.

?????? ?? ??? ??????? C# ??????? ?????? ???? ????? ????? ??? ??? ????? Windows. ?????? ???????? Windows ????? ????? ????? ???????? ????? ???????? ??????? ???????? ? ??? ????? ??????? ??????? ?? ??? ???????? ??? "??????".
  1. ?? ?????? ????????? ??????? ?? ??? .cs. ????? ??????? ????? ??????? ????????:
    using System.Runtime.InteropServices;
    using System;
    using System.Security;
    using System.Security.Permissions;
    using System.Collections;
    using System.IO;
    using System.Text;
    using System.Windows.Forms;
    
    namespace MyOfficeNetAddin
    {
        /// <devdoc>
        ///     This class is intended to use with the C# 'using' statement in
        ///     to activate an activation context for turning on visual theming at
        ///     the beginning of a scope, and have it automatically deactivated
        ///     when the scope is exited.
        /// </devdoc>
    
    [ SuppressUnmanagedCodeSecurity ]
    internal class EnableThemingInScope : IDisposable
    {
       // Private data
    	  private uint  cookie;
       private static ACTCTX enableThemingActivationContext;
       private static IntPtr hActCtx;
       private static bool contextCreationSucceeded = false;
    
       public EnableThemingInScope(bool enable)
       {
       cookie = 0;
       if (enable && OSFeature.Feature.IsPresent(OSFeature.Themes))
       {
        if (EnsureActivateContextCreated())
        {
         if (!ActivateActCtx(hActCtx, out cookie))
         {
             // Be sure cookie always zero if activation failed
             cookie = 0;
         }
        }
       }
      }
    
      ~EnableThemingInScope()
      {
       Dispose(false);
      }
    
      void IDisposable.Dispose()
      {
       Dispose(true);
      }
    
      private void Dispose(bool disposing)
      {
       if (cookie != 0)
       {
        if (DeactivateActCtx(0, cookie))
        {
           // deactivation succeeded...
           cookie = 0;
        }
       }
      }
    
      private bool EnsureActivateContextCreated()
      {
       lock (typeof(EnableThemingInScope))
       {
        if (!contextCreationSucceeded)
        {
         // Pull manifest from the .NET Framework install
         // directory
    
         string assemblyLoc = null;
                            
         FileIOPermission fiop = new FileIOPermission(PermissionState.None);
         fiop.AllFiles = FileIOPermissionAccess.PathDiscovery;
         fiop.Assert();
         try
         {
          assemblyLoc = typeof(Object).Assembly.Location;
         }
         finally
         { 
          CodeAccessPermission.RevertAssert();
         }
    
         string manifestLoc = null;
         string installDir = null;
         if (assemblyLoc != null)
         {
          installDir = Path.GetDirectoryName(assemblyLoc);
          const string manifestName = "XPThemes.manifest";
          manifestLoc = Path.Combine(installDir, manifestName);
         }
    
         if (manifestLoc != null && installDir != null)
         {
          enableThemingActivationContext = new ACTCTX();
          enableThemingActivationContext.cbSize = Marshal.SizeOf(typeof(ACTCTX));
    	     enableThemingActivationContext.lpSource = manifestLoc;
    
          // Set the lpAssemblyDirectory to the install
          // directory to prevent Win32 Side by Side from
          // looking for comctl32 in the application
          // directory, which could cause a bogus dll to be
          // placed there and open a security hole.
    	     enableThemingActivationContext.lpAssemblyDirectory = installDir;
    	     enableThemingActivationContext.dwFlags = ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID; 
     
    	     // Note this will fail gracefully if file specified
          // by manifestLoc doesn't exist.
          hActCtx = CreateActCtx(ref enableThemingActivationContext);
          contextCreationSucceeded = (hActCtx != new IntPtr(-1));
         }
        }
    
        // If we return false, we'll try again on the next call into
        // EnsureActivateContextCreated(), which is fine.
        return contextCreationSucceeded;
       }
      }
    
      // All the pinvoke goo...
      [DllImport("Kernel32.dll")]
      private extern static IntPtr CreateActCtx(ref ACTCTX actctx);
      [DllImport("Kernel32.dll")]
      private extern static bool ActivateActCtx(IntPtr hActCtx, out uint lpCookie);
      [DllImport("Kernel32.dll")]
      private extern static bool DeactivateActCtx(uint dwFlags, uint lpCookie);
    
      private const int ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID = 0x004;
                
      private struct ACTCTX 
      {
       public int       cbSize;
       public uint      dwFlags;
       public string    lpSource;
       public ushort    wProcessorArchitecture;
       public ushort    wLangId;
       public string    lpAssemblyDirectory;
       public string    lpResourceName;
       public string    lpApplicationName;
      }
     }
    }
    
  2. ????? ??????? ???????? ?????? ??????? ???????. ??? ??????? ?????? ???? ????? ????? ??? ??? ????? ??? ????? ????:
    using( new EnableThemingInScope( true ) )
    {
     Form1 form1 = new Form1();
     form1.CreateControl();
    }
    

?????

?????? ??? ???? ?? ????????? ??? ????? ??????? ????? ????? Windows XP (????) ?? ?????? ???? Microsoft MSDN ??????:
http://msdn2.microsoft.com/en-us/library/ms997646.aspx

???????

???? ???????: 830033 - ????? ??? ??????: 29/???? ??????/1428 - ??????: 6.7
????? ???
  • Microsoft Office Basic 2007
  • Microsoft Office Basic Edition 2003
  • Microsoft Office Professional 2007
  • Microsoft Office Professional Edition 2003
  • Microsoft Office Small Business 2007
  • Microsoft Office Small Business Edition 2003
  • Microsoft Office Standard 2007
  • Microsoft Office Standard Edition 2003
  • Microsoft Office Home and Student 2007
  • Microsoft Office Student and Teachers Edition 2003
  • Microsoft Office Access 2007
  • Microsoft Office Access 2003
  • Microsoft Office Excel 2007
  • Microsoft Office Excel 2003
  • Microsoft Office FrontPage 2003
  • Microsoft Office Outlook 2007
  • Microsoft Office Outlook 2003
  • Microsoft Office PowerPoint 2007
  • Microsoft Office PowerPoint 2003
  • Microsoft Office Project Professional 2007
  • Microsoft Office Project Professional 2003
  • Microsoft Office Project Standard 2007
  • Microsoft Office Project Standard 2003
  • Microsoft Office Publisher 2007
  • Microsoft Office Publisher 2003
  • Microsoft Office Visio Professional 2007
  • Microsoft Office Visio Professional 2003
  • Microsoft Office Visio Standard 2007
  • Microsoft Office Visio Standard 2003
  • Microsoft Office Word 2007
  • Microsoft Office Word 2003
????? ??????: 
kbmt kbprogramming kbcode kbhowtomaster KB830033 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????830033

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

 

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