INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Issue with COM Interface from C++  (Read 3562 times)

dean70

  • Citizen of the Universe
  • *****
  • Posts: 508
Issue with COM Interface from C++
« on: November 26, 2015, 04:55:01 pm »

I have found an issue with the COM Interface when connecting to JRiver from an Out of Process exe. The following code will fail with an 'Invalid Class String' HRESULT on both calls:

HRESULT hr = pMJ.GetActiveObject(L"MediaJukebox Application");
    if (hr != S_OK)
        hr = pMJ.CreateInstance(L"MediaJukebox Application");
    if (hr != S_OK)
   return false;

If I replace the L"MediaJukebox Application" with the corresponding GUID L"{572802d5-fbf6-4c30-89ca-bdf2ce4aec2b}", the call will work correctly. I found the GUID from the .tlh file auto-generated by Visual C++ 2010 during compile.

Any ideas why the Automation object cannot be instantiated by its name?

Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 41949
  • Shoes gone again!
Re: Issue with COM Interface from C++
« Reply #1 on: November 26, 2015, 06:11:58 pm »

This is the code:
https://wiki.jriver.com/index.php/Media_Center_Automation

I'm not sure what's going wrong.
Logged
Matt Ashland, JRiver Media Center

dean70

  • Citizen of the Universe
  • *****
  • Posts: 508
Re: Issue with COM Interface from C++
« Reply #2 on: November 26, 2015, 07:28:38 pm »

Thanks, I used this page as a template for the code.

I am using this to load the tlb:
#import "C:\Program Files (x86)\J River\Media Center 20\Media Center 20.tlb" no_namespace, named_guids \
   rename("DeleteFile","MCDeleteFile") \
   rename("MoveFile","MCMoveFile") \
   rename("ReportEvent","MCReportEvent")


...anyway it is working now using the GUID above. I can now have an OSD volume control similar to Theatre View for the NetFlix app, which is routing audio through the WDM Driver.  ;D
Logged
Pages: [1]   Go Up