這些錯誤的發生原因是外部的多執行緒應用程式和 Visual Studio 之間出現執行緒爭用問題。 您可以在 Visual Studio Automation 應用程式中實作 IOleMessageFilter 錯誤處理常式,藉以排除這些錯誤(請勿將 IOleMessageFilter 與 System.Windows.Forms.IMessageFilter 混淆)。若要修
EnvDTE80.DTE2 dte;objectobj =null; System.Type t =null;// Get the ProgID for DTE 8.0.t = System.Type.GetTypeFromProgID("VisualStudio.DTE.10.0",true);// Create a new instance of the IDE.obj = System.Activator.CreateInstance(t,true);// Cast the instance to DTE2 and assign to v...
{ EnvDTE80.DTE2 dte;objectobj =null; System.Type t =null;// Get the ProgID for DTE 8.0.t = System.Type.GetTypeFromProgID("VisualStudio.DTE.10.0",true);// Create a new instance of the IDE.obj = System.Activator.CreateInstance(t,true);// Cast the instance to DTE2 and assign to ...
{ EnvDTE80.DTE2 dte;objectobj =null; System.Type t =null;// Get the ProgID for DTE 8.0.t = System.Type.GetTypeFromProgID("VisualStudio.DTE.10.0",true);// Create a new instance of the IDE.obj = System.Activator.CreateInstance(t,true);// Cast the instance to DTE2 and assign to ...
("VisualStudio.DTE.10.0",true);// Create a new instance of the IDE.obj = System.Activator.CreateInstance(t,true);// Cast the instance to DTE2 and assign to variable dte.dte = (EnvDTE80.DTE2)obj;// Register the IOleMessageFilter to handle any threading// errors.MessageFilter.Regist...
{ EnvDTE80.DTE2 dte;objectobj =null; System.Type t =null;// Get the ProgID for DTE 8.0.t = System.Type.GetTypeFromProgID("VisualStudio.DTE.10.0",true);// Create a new instance of the IDE.obj = System.Activator.CreateInstance(t,true);// Cast the instance to DTE2 and assign to ...
{ EnvDTE80.DTE2 dte;objectobj =null; System.Type t =null;// Get the ProgID for DTE 8.0.t = System.Type.GetTypeFromProgID("VisualStudio.DTE.10.0",true);// Create a new instance of the IDE.obj = System.Activator.CreateInstance(t,true);// Cast the instance to DTE2 and assign to ...