0

When trying to Rotate Desktop, running the code in a Remote Desktop, I've got the exception:

Error trying to GetActiveDisplays() : QueryDisplayConfig() failed. Status: InvalidParameter;

Running it in local works fine!

It is not possible to do in Remote Desktop?

The code is:

var pathInfoArray = new DisplayConfigPathInfo[numPathArrayElements];
var modeInfoArray = new DisplayConfigModeInfo[numModeInfoArrayElements];

// topology ID only valid with QDC_DATABASE_CURRENT
var queryDisplayStatus = pathType == QueryDisplayFlags.DatabaseCurrent ?
CCDWrapper.QueryDisplayConfig(
pathType,
ref numPathArrayElements, pathInfoArray,
ref numModeInfoArrayElements, modeInfoArray, out topologyId) :

CCDWrapper.QueryDisplayConfig(
pathType,
ref numPathArrayElements, pathInfoArray,
ref numModeInfoArrayElements, modeInfoArray);

Running this on remote desktops queryDisplayStatus returns with InvalidParameter.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
André
  • 53
  • 1
  • 2
  • 8
  • `Error Code and Description` for the following `ERROR_INVALID_PARAMETER The combination of parameters and flags that are specified is invalid.` so can you show the exact method and call that you are using in your local environment that's working..? – MethodMan Sep 22 '14 at 14:36
  • not sure if this will help but what the heck http://support.smartbear.com/viewarticle/56548/ – MethodMan Sep 22 '14 at 14:39
  • Just updated with the code – André Sep 22 '14 at 14:54
  • ok looking at the code if it works on your local and not on the remote I am wondering what `var pathInfoArray` value is when you debug it locally I bet there is an issue with file paths not being the same locally vs remotely – MethodMan Sep 22 '14 at 14:59
  • look at this example I do not see a QueryOnlyActivePaths in your example maybe this could be what's also missing .. http://stackoverflow.com/questions/11087613/how-do-i-set-the-monitor-orientation-in-windows-7 – MethodMan Sep 22 '14 at 15:01

0 Answers0