Microsoft.Xna.Arm.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //-----------------------------------------------------------------------------
  2. // Wrapper to simplify using the ARM API from C++, via managed -> COM interop.
  3. //
  4. // Microsoft XNA
  5. // Copyright (C) Microsoft Corporation. All rights reserved.
  6. //-----------------------------------------------------------------------------
  7. #ifndef __MICROSOFT_XNA_ARM_H__
  8. #define __MICROSOFT_XNA_ARM_H__
  9. #include <comdef.h>
  10. namespace Microsoft
  11. {
  12. namespace Xna
  13. {
  14. namespace Arm
  15. {
  16. #import "Microsoft.Xna.Arm.tlb" no_namespace
  17. inline IProviderEnginePtr CreateProviderEngine(const char *toolName, const char *toolVersion)
  18. {
  19. IComFactory *factory = NULL;
  20. HRESULT hr = CoCreateInstance(__uuidof(ComFactory),
  21. NULL,
  22. CLSCTX_INPROC_SERVER,
  23. __uuidof(IComFactory),
  24. reinterpret_cast<void **>(&factory));
  25. if (FAILED(hr))
  26. return NULL;
  27. IProviderEnginePtr provider = factory->Create(toolName, toolVersion);
  28. factory->Release();
  29. return provider;
  30. }
  31. }
  32. }
  33. }
  34. #endif