locked
How to integrate Media Foundation with WinRTComponentDLL?

    Question

  • Hi,

    I am creating a WinRTComponentDLL to do something related to Media Foundation.

    I am using Source Reader and reference to the Media Foundation Sample:  VideoThumbnail

    But when I try to merge the sample code to my component. I found some basic error like:

     

    error C2061: syntax error : identifier 'PAGESET'


    error C3861: 'SetRectEmpty': identifier not found


    1>Thumbnail.cpp(100): error C3861: 'PropVariantInit': identifier not found
     
    1>Thumbnail.cpp(139): error C3861: 'PropVariantInit': identifier not found
     
    1>Thumbnail.cpp(156): error C3861: 'PropVariantToUInt32': identifier not found
     
    1>Thumbnail.cpp(562): error C3861: 'MulDiv': identifier not found
     
    1>Thumbnail.cpp(567): error C3861: 'MulDiv': identifier not found

    These error are platform related.


    What should I do to avoid these issue?

    Thank you~~

    Eric
    Thursday, November 03, 2011 4:59 PM

Answers

All replies

  • It seems either you have missed including some headers or the API/Types you are trying to use are not available in the SDK for Metro style apps.

    Win32/COM Multimedia API available for Metro style apps can be found here:

    http://msdn.microsoft.com/en-us/library/windows/apps/hh452756(v=VS.85).aspx

     


    Raman Sharma | Program Manager, Visual C++ | @rasharm_msft

    (if my post has answered your question, please consider using the 'mark as answer' feature in the forums to help others)
    • Marked as answer by Peng Huan Hung Friday, November 04, 2011 1:16 AM
    • Unmarked as answer by Peng Huan Hung Friday, November 04, 2011 1:44 AM
    • Marked as answer by Peng Huan Hung Friday, November 04, 2011 2:57 AM
    Thursday, November 03, 2011 6:05 PM
  • Thanks, got it. Seems it's not so easy to move the Media Foundation Sample to Metro directly.   ^^!!

     

    Eric

    Friday, November 04, 2011 1:16 AM
  • Hi Raman,

    I check the undefined function, all functions are just from the basic header like WinUser.h or propidl.h

    Can I know such kind header's capability for metro apps? This seems the basic function of the system.

    ex: IMFSourceReader is on the support list. It's method:IMFSourceReader::GetPresentationAttribute has definition:

    HRESULT GetPresentationAttribute( [in] DWORD dwStreamIndex, [in] REFGUID guidAttribute, [out] PROPVARIANT *pvarAttribute );

    the PropVariantInit is the utility function used to init PROPVARIANT in general case. Is it possible know I am missing some include files or this utility is just not permitted under metro. Because I can't identify the case by look into the PropIdl.h directly.

    Thank you~~

     

    Eric



    Friday, November 04, 2011 1:48 AM
  • I am not sure, but it seems the codes under this section are not available for metro app.

    WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)

    Friday, November 04, 2011 2:57 AM
  • Correct
    Raman Sharma | Program Manager, Visual C++ | @rasharm_msft

    (if my post has answered your question, please consider using the 'mark as answer' feature in the forums to help others)
    Sunday, November 06, 2011 1:57 AM