INTERACT FORUM

Please login or register.

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

Author Topic: Cannot access methods from Media Center 17.tlb  (Read 1656 times)

dermeister

  • Member
  • *
  • Posts: 1
Cannot access methods from Media Center 17.tlb
« on: June 29, 2012, 06:11:25 pm »

I am pretty inexperienced with COM/ATL programming, so this is probably an easy question. I followed the http://yabb.jriver.com/interact/index.php?topic=66116.0 guide to write a test plugin with event notifications. I attach the IMJAutomation * that is passed into the init function by doing the following:

Code: [Select]
STDMETHODIMP CtestJRMCPluginCtrl::Init(IDispatch* pMJ)
{
m_pMJ.Attach((IMJAutomation *) pMJ, TRUE);
HRESULT hr = m_pMJ.GetActiveObject(L"MediaJukebox Application");
if (hr != S_OK)
        m_pMJ.CreateInstance(L"MediaJukebox Application");
}

where m_pMJ is of type IMJAutomationPtr. Everything works fine and things compile until I add the line

Code: [Select]
IMJZoneAutomationPtr zPtr = m_pMJ->GetZones();
which returns the error:

Code: [Select]
1>c:\users\dermeister\documents\visual studio 2010\projects\testjrmcplugin\testjrmcplugin\testjrmcpluginctrl.cpp(28): error C2039: 'GetZones' : is not a member of 'IMJAutomation'
1>          c:\users\dermeister\documents\visual studio 2010\projects\testjrmcplugin\testjrmcplugin\debug\media center 17.tlh(101) : see declaration of 'IMJAutomation'

So apparently the compiler is not seeing the declaration of GetZones() in the generated media center 17.tlh file. Looking at the file, I can however find:

Code: [Select]
IMJAutomation : IDispatch
{
...
    IMJZonesAutomationPtr GetZones ( );
...
}

I am importing the Media Center 17.tlb file in my testJRMCPluginCtrl.h file using:

Code: [Select]
#import "C:\Program Files (x86)\J River\Media Center 17\Media Center 17.tlb" no_namespace, named_guids \
rename("DeleteFile","MCDeleteFile") \
rename("MoveFile","MCMoveFile") \
rename("ReportEvent","MCReportEvent")

and am of course including that header in my cpp file. I also tested this with several other methods that are part of IMJAutomation and none of them compile. Visual Studio does auto complete them for me when typing though, so it should be able to see them.

I would really appreciate any help in getting this error resolved!
Logged
Pages: [1]   Go Up