locked
Windows App certification kit 3.3 : This API is not supported for this application type - Api=CoCreateInstanceFromApp. Module=ole32.dll RRS feed

  • Question

  • When trying to run the Windows App certification kit 3.3 I get

    Supported API test

    FAILED
    Supported APIs

    •Error Found: The supported APIs test detected the following errors:◦This API is not supported for this application type - Api=CoCreateInstanceFromApp. Module=ole32.dll. File=Splat.dll.

    •Impact if not fixed: Using an API that is not part of the Windows SDK for Windows Phone Store apps violates the Windows Phone Store certification requirements.


    CoCreateInstanceFromApp is explicitly a WinRT API: http://msdn.microsoft.com/en-us/library/windows/desktop/hh404137(v=vs.85).aspx,

    Windows Phone 8: This API is supported.
    Windows Phone 8.1: This API is supported.

    • Edited by AlSki.net Tuesday, September 9, 2014 8:43 AM updated with explicit copy of eligibility
    Tuesday, September 9, 2014 8:37 AM

Answers

  • You need to call it from a Windows Runtime Component. I just confirmed that a Windows Phone Runtime app calling CoCreateInstanceFromApp in a Windows Runtime Component passes the WACK.

    Also note that it's documented as being in combase.dll, not ole32.dll.

    Saturday, September 20, 2014 1:54 AM
    Moderator

All replies

  • Hi,

    Could you please try to post a simple sample that will show this issue to the OneDrive? Then I want to have a test in my side.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, September 10, 2014 6:00 AM
    Moderator
  • See https://skydrive.live.com/redir?resid=153ABCF37FB24727!49428

    It is literally a new Universal Hub App, with the following NativeMethods class added.

      internal class NativeMethods
        {
             [DllImport("ole32.dll", ExactSpelling = true, EntryPoint = "CoCreateInstanceFromApp", PreserveSig = true)]
             public static extern int CoCreateInstanceFromApp(
                 [In, MarshalAs(UnmanagedType.LPStruct)] Guid rclsid,
                 IntPtr pUnkOuter,
                 CLSCTX dwClsContext,
                 IntPtr reserved,
                 int countMultiQuery,
                 ref MultiQueryInterface query);
         }

        [Flags]
        internal enum CLSCTX : uint
        {
            CLSCTX_INPROC_SERVER = 0x1,
            CLSCTX_INPROC_HANDLER = 0x2,
            CLSCTX_LOCAL_SERVER = 0x4,
            CLSCTX_INPROC_SERVER16 = 0x8,
            CLSCTX_REMOTE_SERVER = 0x10,
            CLSCTX_INPROC_HANDLER16 = 0x20,
            CLSCTX_RESERVED1 = 0x40,
            CLSCTX_RESERVED2 = 0x80,
            CLSCTX_RESERVED3 = 0x100,
            CLSCTX_RESERVED4 = 0x200,
            CLSCTX_NO_CODE_DOWNLOAD = 0x400,
            CLSCTX_RESERVED5 = 0x800,
            CLSCTX_NO_CUSTOM_MARSHAL = 0x1000,
            CLSCTX_ENABLE_CODE_DOWNLOAD = 0x2000,
            CLSCTX_NO_FAILURE_LOG = 0x4000,
            CLSCTX_DISABLE_AAA = 0x8000,
            CLSCTX_ENABLE_AAA = 0x10000,
            CLSCTX_FROM_DEFAULT_CONTEXT = 0x20000,
            CLSCTX_ACTIVATE_32_BIT_SERVER = 0x40000,
            CLSCTX_ACTIVATE_64_BIT_SERVER = 0x80000,
            CLSCTX_INPROC = CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER,
            CLSCTX_SERVER = CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER,
            CLSCTX_ALL = CLSCTX_SERVER | CLSCTX_INPROC_HANDLER
        }

        [StructLayout(LayoutKind.Sequential)]
        internal struct MultiQueryInterface
        {
            public IntPtr InterfaceIID;
            public IntPtr IUnknownPointer;
            public int ResultCode;
        }

    Wednesday, September 10, 2014 6:48 AM
  • Hello Amy,

    I'm waiting to get an App through submission and certification with this issue. Have you had any chance to look at this?

    Friday, September 19, 2014 6:29 AM
  • You need to call it from a Windows Runtime Component. I just confirmed that a Windows Phone Runtime app calling CoCreateInstanceFromApp in a Windows Runtime Component passes the WACK.

    Also note that it's documented as being in combase.dll, not ole32.dll.

    Saturday, September 20, 2014 1:54 AM
    Moderator
  • Hey Rob,

    Why is there a distinction between a C# library that declares WinRT objects, and one that does not? Why would APIs be restricted to one context and not the other, if both are user-submitted code? 

    Also note that it's documented as being in combase.dll, not ole32.dll.

    I wonder if this is actually the cause of the failure and it's not related to being a WinRT component at all?


    Tuesday, September 23, 2014 8:12 PM