locked
Can't use DEMAutomationWrapper RRS feed

  • Question

  • I'm developing test automation for Mobile 6, and need to automate the emulator. I downloaded DEMAutomationWrapper and the demo apps, but I can't get it to work. I keep getting "Not Registered" when I try to use it, and when I try to register it, I get something about it not being possible due to having no registration entry point. I've reinstalled it several times but to no avail. Any suggestions?

    I'm on 64 bit Windows 7 using VS2008 Professional on a quad core PC. My emulators work fine when I use them in interactive mode, but I just can't automate them.

    Tuesday, June 8, 2010 1:33 PM

All replies

  • I think you were refering to the article How To: Programmatically Control the Windows Mobile Device Emulators from .NET. 

    Could you tell me when and where the error was thrown? I would suggest that you debug the code step by step and try to find out what might be wrong. If you couldn't find it on your own, please describe the circumstances more clearly so that others can help.


    Please mark the post that helps you, and unmark that does not. This benefits our community.
    Thursday, June 10, 2010 9:16 AM
  • It's pretty easy. I installed the component and ran the following program:

    #region
    
    using System;
    using Microsoft.DeviceEmulatorManager.Interop;
    
    #endregion
    
    namespace ControlEmulator
    {
      internal class Program
      {
        private static void Main(string[] args)
        {
          var tester = new DeviceEmulatorManagerClass();
          string temp = tester.EnumerateSDKs().ToString();
          Console.WriteLine(temp);
        }
      }
    }

    It breaks on the EnumerateSDKs line with the following error:

    An unhandled exception of type 'System.InvalidCastException' occurred in ControlEmulator.exe

    Additional information: Unable to cast COM object of type 'Microsoft.DeviceEmulatorManager.Interop.DeviceEmulatorManagerClass' to interface type 'Microsoft.DeviceEmulatorManager.Interop.IDeviceEmulatorManager'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{BE72DA87-85CC-4C35-B336-8921D82AA41E}' failed due to the following error: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

    If I try registering it by running regsvr32 "C:\Program Files (x86)\Microsoft Device Emulator\1.0\Microsoft.DeviceEmulatorManager.Interop.9.0.dll"

    I get "The module ... was loaded but the entry-point DllRegisterServer was not found..."

    Thursday, June 10, 2010 1:39 PM
  • Did you run your application elevated? I mean your application needs administrator privilege on Windows 7. To do so, right click on the application and then select "Run as administrator" (Note that this is different from logging in as an administrator due to UAC). When you debug the application in Visual Studio, you can simply run Visual Studio elevated.


    Please mark the post that helps you, and unmark that does not. This benefits our community.
    Friday, June 11, 2010 6:50 AM
  • Same problem.

    Friday, June 11, 2010 1:58 PM
  • The original questioner will long ago have lost interest in this thread but I came across it while experiencnig the same issue and I think I have the solution.

    The problem here is that the machine is 64 bit and the application is building under the platform "Any CPU". When it runs it runs in 64 bit and tries to access the main registry but the DEMCOMInterface appears to be 32 bit and is only registered in the WOW registry. Fixing it is as simple as switching the Platform you build under to be x86. The DEM Automation Wrapper solution is likewise affected.

    Of course the line "tester.EnumerateSDKs().ToString()" doesn't actually (and never wourld) return a nicely formatted list of SDKs but at least it doesn't error! :)

    • Proposed as answer by John Swallow Saturday, April 21, 2012 10:49 AM
    Saturday, April 21, 2012 10:49 AM