locked
Urgent: How to integrate win32 api into Win Store App RRS feed

  • Question

  • Hi, I was given a win32 Api for handling Camera Light On and off , the files are as below:

    1. DLL

    2. C++ Header file

    3. Object file library

    How to I integrate this win32 Api into Win store app so that I can turn on /off the camera light.

    here the C++ Header file info. Can this be used in Win Store App??

    /**
     Camera Light API

    */
    #ifdef LIGHTSWDLL_API
    #define LIGHTSWDLL_API __declspec(dllexport)
    #else
    #define LIGHTSWDLL_API __declspec(dllimport)
    #endif

    #ifdef __cplusplus
    extern "C" {  // only need to export C interface if
                  // used by C++ source code
    #endif
    LIGHTSWDLL_API int PASCAL CameraLight_Initialize( LONG_PTR ptl );
    LIGHTSWDLL_API int PASCAL CameraLight_TurnOn( );
    LIGHTSWDLL_API int PASCAL CameraLight_TurnOff( );
    LIGHTSWDLL_API int PASCAL CameraLight_Switch( );
    LIGHTSWDLL_API int PASCAL CameraLight_SetValueToKeepOnTime( BYTE bSetTimer );
    LIGHTSWDLL_API int PASCAL CameraLight_GetValueToKeepOnTime( BYTE &bGetTimer );
    LIGHTSWDLL_API int PASCAL CameraLight_TurnOnForTime( BYTE bSetTimer );
    LIGHTSWDLL_API int PASCAL CameraLight_GetTimerStatus( BYTE &bGetTimer );
    LIGHTSWDLL_API int PASCAL CameraLight_TurnOnToKeepOn( );
    LIGHTSWDLL_API int PASCAL CameraLight_SetValueToKeepOn( );
    LIGHTSWDLL_API int PASCAL CameraLight_GetVersion( LPWSTR lpData, LPDWORD lpSize );
    #ifdef __cplusplus
    }
    #endif

    Thanks


    • Edited by FireDance Monday, November 17, 2014 3:12 AM additonal info
    Monday, November 17, 2014 2:10 AM

Answers

  • Hello,

    The APIs you are trying to call to turn the camera LED on and off may not be allowed in Windows Store apps. As per our previous conversation you will need to use the  VideoDeviceController.TorchControl to turn on the camera's LED. If this API does not work you will need to contact the OEM and request additional information from them about how to control the hardware.

    The following is an alphabetically sorted list of the Win32 and COM interface and functions that are provided for developing Windows Runtime apps:

    http://msdn.microsoft.com/en-us/library/windows/apps/dn424765.aspx

    I hope this helps,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Monday, November 17, 2014 10:25 PM
    Moderator

All replies

  • Hello,

    The APIs you are trying to call to turn the camera LED on and off may not be allowed in Windows Store apps. As per our previous conversation you will need to use the  VideoDeviceController.TorchControl to turn on the camera's LED. If this API does not work you will need to contact the OEM and request additional information from them about how to control the hardware.

    The following is an alphabetically sorted list of the Win32 and COM interface and functions that are provided for developing Windows Runtime apps:

    http://msdn.microsoft.com/en-us/library/windows/apps/dn424765.aspx

    I hope this helps,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Monday, November 17, 2014 10:25 PM
    Moderator
  • Hi James,

    I confirmed that the specific tablet I used :

    MediaCapture api( VideoDeviceControler for Torch,Flash)  unable to communicate the device camera's driver.

    Now seeking help from the OEM.

    Will update here once I got news from them.

    Thank you for the advice to seek assistance from the OEM.

    Tuesday, November 18, 2014 3:08 AM