⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cameracapturedll.cpp

📁 windows CE 一些有用的源代码 比如camera
💻 CPP
字号:
// CameraCaptureDLL.cpp : Defines the entry point for the DLL application.
//

#include "stdafx.h"
#include <windows.h>
#include <winbase.h>
#include <objbase.h>
#include <commctrl.h>

CGraphManager *m_pGraphManager;

BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved
					 )
{

	if (ul_reason_for_call==DLL_PROCESS_ATTACH)
		CoInitializeEx(NULL, COINIT_MULTITHREADED);
	if (ul_reason_for_call==DLL_PROCESS_DETACH)
		CoUninitialize();
    return TRUE;
}

extern "C" bool __declspec(dllexport) Init()
{
	HRESULT hr = S_OK;

    // Create the graph manager. This will control the dshow capture pipeline
    m_pGraphManager = new CGraphManager();
    if( m_pGraphManager == NULL )
    {
        ERR( E_OUTOFMEMORY );
    }
    CHK( m_pGraphManager->Init());
    CHK( m_pGraphManager->BuildCaptureGraph());
    CHK( m_pGraphManager->RunCaptureGraph());

Cleanup:
    return hr==S_OK; 
}

extern "C" bool __declspec(dllexport) Shutdown()
{
	HRESULT hr = S_OK;

	if( m_pGraphManager == NULL )
    {
        ERR( E_OUTOFMEMORY );
    }
	m_pGraphManager->ShutDown();

Cleanup:
    return hr==S_OK; 
}

extern "C" bool __declspec(dllexport) Run()
{
	HRESULT hr = S_OK;

	if( m_pGraphManager == NULL )
    {
        ERR( E_OUTOFMEMORY );
    }

	m_pGraphManager->StartCapture();

Cleanup:
    return hr==S_OK; 
}

extern "C" bool __declspec(dllexport) Stop()
{
	HRESULT hr = S_OK;

	if( m_pGraphManager == NULL )
    {
        ERR( E_OUTOFMEMORY );
    }

	m_pGraphManager->StopCapture();

Cleanup:
    return hr==S_OK; 
}

// Set the URL
// Get the count of capture / sent?
// IsRunning?

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -