aboutsummaryrefslogtreecommitdiffstats
path: root/QtVsTools.Core
diff options
context:
space:
mode:
authorMiguel Costa <miguel.costa@qt.io>2021-10-29 15:35:56 +0200
committerMiguel Costa <miguel.costa@qt.io>2021-11-16 15:40:18 +0000
commited491ab5dcfa32c8ae166b3f287eee8b7004b3a9 (patch)
tree34cd886653569169ba5e9e096fd3c3e5ea39f4e2 /QtVsTools.Core
parent95782fa69343bd5d8c5270de15fba5efe409bc53 (diff)
refactoring: Add support for VS 2022
This patch includes changes required to support Visual Studio 2022. Fixes: QTVSADDINBUG-920 Change-Id: I2494724a660535c7a1868e60b3981e46c109570c Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Diffstat (limited to 'QtVsTools.Core')
-rw-r--r--QtVsTools.Core/BuildConfig.cs2
-rw-r--r--QtVsTools.Core/HelperFunctions.cs7
-rw-r--r--QtVsTools.Core/MainWinWrapper.cs4
-rw-r--r--QtVsTools.Core/Resources.cs2
4 files changed, 12 insertions, 3 deletions
diff --git a/QtVsTools.Core/BuildConfig.cs b/QtVsTools.Core/BuildConfig.cs
index 6b184848..47d438f8 100644
--- a/QtVsTools.Core/BuildConfig.cs
+++ b/QtVsTools.Core/BuildConfig.cs
@@ -43,6 +43,8 @@ namespace QtVsTools.Core
return "141";
#elif VS2019
return "142";
+#elif VS2022
+ return "143";
#else
#error Unknown Visual Studio version!
#endif
diff --git a/QtVsTools.Core/HelperFunctions.cs b/QtVsTools.Core/HelperFunctions.cs
index 220d32f1..865d7436 100644
--- a/QtVsTools.Core/HelperFunctions.cs
+++ b/QtVsTools.Core/HelperFunctions.cs
@@ -1691,7 +1691,10 @@ namespace QtVsTools.Core
private static string GetVCPathFromRegistry()
{
-#if VS2019
+#if VS2022
+ Debug.Assert(false, "VCPath for VS2022 is not available through the registry");
+ string vcPath = string.Empty;
+#elif VS2019
Debug.Assert(false, "VCPath for VS2019 is not available through the registry");
string vcPath = string.Empty;
#elif VS2017
@@ -1730,7 +1733,7 @@ namespace QtVsTools.Core
return false;
string comspecPath = Environment.GetEnvironmentVariable("COMSPEC");
-#if (VS2017 || VS2019)
+#if (VS2017 || VS2019 || VS2022)
string vcVarsCmd = "";
string vcVarsArg = "";
if (isOS64Bit && isQt64Bit)
diff --git a/QtVsTools.Core/MainWinWrapper.cs b/QtVsTools.Core/MainWinWrapper.cs
index d0ead95e..f8beb439 100644
--- a/QtVsTools.Core/MainWinWrapper.cs
+++ b/QtVsTools.Core/MainWinWrapper.cs
@@ -45,7 +45,11 @@ namespace QtVsTools.Core
get
{
if (dteObject != null)
+#if VS2022
+ return dteObject.MainWindow.HWnd;
+#else
return new IntPtr(dteObject.MainWindow.HWnd);
+#endif
return new IntPtr(0);
}
}
diff --git a/QtVsTools.Core/Resources.cs b/QtVsTools.Core/Resources.cs
index 2bfced2b..00d9fabd 100644
--- a/QtVsTools.Core/Resources.cs
+++ b/QtVsTools.Core/Resources.cs
@@ -135,7 +135,7 @@ namespace QtVsTools.Core
public const string registryPackagePath = registryRootPath + "\\Qt5VS2013";
#elif VS2015
public const string registryPackagePath = registryRootPath + "\\Qt5VS2015";
-#elif (VS2017 || VS2019)
+#elif (VS2017 || VS2019 || VS2022)
public const string registryPackagePath = registryRootPath + "\\Qt5VS2017";
#else
#error Unknown Visual Studio version!