Question

I am trying trying to modify UVC Extension Unit code provided in MSDN link. I have added additional methods to CExtension class provided in XUProxy.cpp. Added all those methods are also included to interface.idl file.

Here is the code snippet.

STDMETHODIMP CExtension::GetAllCapDevices(
        PDEVICELIST pList,
        ULONG *pulDevCount,
        ULONG ulListNum)
{
    HRESULT hr = S_OK;
    IEnumMoniker *pEnum;

    CoInitializeEx(NULL, COINIT_MULTITHREADED);
    
    hr = EnumerateDevices(CLSID_VideoInputDeviceCategory, &pEnum);
    if (SUCCEEDED(hr))
    {
        DisplayDeviceInformation(pEnum);
        pEnum->Release();
    }
    
    return hr;
}

EnumerateDevices and DisplayDeviceInformation is same as provided in http://msdn.microsoft.com/en-us/library/windows/desktop/dd377566%28v=vs.85%29.aspx.

I have added streams.h, strmbase.lib and strmiids.lib to the source file as follows.

TARGETLIBS= \
        $(SDK_LIB_PATH)\kernel32.lib            \
        $(SDK_LIB_PATH)\user32.lib              \
        $(SDK_LIB_PATH)\gdi32.lib               \
        $(SDK_LIB_PATH)\advapi32.lib            \
        $(SDK_LIB_PATH)\comdlg32.lib            \
        $(SDK_LIB_PATH)\ole32.lib               \
        $(SDK_LIB_PATH)\oleaut32.lib            \
        $(SDK_LIB_PATH)\uuid.lib                \
        $(SDK_LIB_PATH)\comctl32.lib            \
        $(SDK_LIB_PATH)\i386\stream.lib         \
        $(SDK_LIB_PATH)\i386\strmbase.lib       \
        $(SDK_LIB_PATH)\i386\strmiids.lib       \
        $(SDK_LIB_PATH)\i386\strsafe.lib

INCLUDES=\
    C:\Program Files\Microsoft SDKs\Windows\v6.1\Include\

On building this source file I receive the following error (took partial details from build log file)

> /Fdd:\uvcextensionunit\win7build\objchk_win7_x86\i386\
1> /DKMDF_MAJOR_VERSION_STRING=01
1> /DKMDF_MINOR_VERSION_STRING=009
1> /wd4603
1> /wd4627
1> /typedil-
1> /FIC:\WinDDK\7600.16385.1\inc\api\warning.h
1> .\xuplugin.cpp .\stdafx.cpp .\xuproxy.cpp 
1>xuplugin.cpp
1>stdafx.cpp
1>statreg.cpp is obsolete. Please remove it from your project.
1>atlimpl.cpp is obsolete. Please remove it from your project.
1>xuproxy.cpp
1>c:\program files\microsoft sdks\windows\baseclasses\streams.h(152) : fatal error C1083: Cannot open include file: 'strmif.h': No such file or directory
1>Generating Code...
1> C:\WinDDK\7600.16385.1\Bin\x86\oacr\oacrlink /lib /out:d:\uvcextensionunit\win7build\objchk_win7_x86\i386\XUPlugin.lib @d:\uvcextensionunit\win7build\objchk_win7_x86\i386\lib.rsp
1>Microsoft (R) Library Manager Version 9.00.30729.207
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>/IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221 
1>/WX 
1>/nodefaultlib 
1>/machine:ix86 
1>/def:XUPlugin.def 
1>d:\uvcextensionunit\win7build\objchk_win7_x86\i386\xuplugin_i.obj 
1>d:\uvcextensionunit\win7build\objchk_win7_x86\i386\xuplugin.obj 
1>d:\uvcextensionunit\win7build\objchk_win7_x86\i386\stdafx.obj 
1>d:\uvcextensionunit\win7build\objchk_win7_x86\i386\xuproxy.obj 
1>LINK : fatal error LNK1181: cannot open input file 'd:\uvcextensionunit\win7build\objchk_win7_x86\i386\xuproxy.obj'
1>errors in directory d:\uvcextensionunit\win7build
1>link : error LNK1181: cannot open input file 'd:\uvcextensionunit\win7build\objchk_win7_x86\i386\xuproxy.obj'
Compile errors: not linking d:\uvcextensionunit\win7build directory *************

Do I make mistake in the syntax of SOURCE file? I have included the path of Platform SDK in INCLUDES field of SOURCE file.

Was it helpful?

Solution

I have solved my issue by rearranging order of header file included in header file and cpp source file of my project.

Have a look at the following link for C/C++ include header file order

Also I made UVC extension unit work perfectly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top