青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

隨筆 - 74, 文章 - 0, 評論 - 26, 引用 - 0
數據加載中……

用戶空間和設備驅動程序通信


CreateFile
ReadFile WriteFile DeviceIoControl (將會產生 IRP 包)
Closehandle

posted @ 2007-11-20 09:35 井泉 閱讀(145) | 評論 (0)編輯 收藏

c++ 和 jscript

#pragma once

#include <afxdisp.h>
#include <activscp.h>

class CCodeObject;
class CScriptSite;

class CScriptingSupportHelper
{
public:
    CScriptingSupportHelper();
    ~CScriptingSupportHelper();

    BOOL Create(CWnd* pWnd);
    BOOL RunScript(CString str);

    CCodeObject* GetCodeObject() const { return m_pCodeObject; }
    CScriptSite* GetScriptSite() const { return m_pScriptSite; }
    IActiveScript* GetActiveScript() const { return m_pActiveScript; }

private:
    CCodeObject* m_pCodeObject;
    CScriptSite* m_pScriptSite;

    IActiveScript* m_pActiveScript;  
    IActiveScriptParse* m_pActiveScriptParse;
};

class CCodeObject : public CCmdTarget
{
public:
    CCodeObject(CScriptingSupportHelper* pScripting, CWnd* pWnd);
    virtual ~CCodeObject();

    void Line(long, long, long, long);
    void Ellipse(long, long, long, long);
    void DrawText(LPCTSTR msg, long x, long y, long w, long h);

    void OnPaint();
    void OnMouseClick(long x, long y);

private:
    CWnd* m_pWnd;
    CScriptingSupportHelper* m_pScripting;
    BOOL GetDispatch(OLECHAR* name, COleDispatchDriver& disp, DISPID& dispid);

    enum
    {
        idLine = 1,
        idEllipse,
        idDrawText,
    };

    DECLARE_DISPATCH_MAP()
};

class CScriptSite : public IActiveScriptSite
{
public:
    CScriptSite(CScriptingSupportHelper* pScripting)  
    {
        m_pScripting = pScripting;
    };
   
    ~CScriptSite() 
    {
    };

    virtual ULONG STDMETHODCALLTYPE AddRef()
    {   
        return InterlockedIncrement(&m_nRefCount);
    }
   
    virtual ULONG STDMETHODCALLTYPE Release()
    {    
        return InterlockedDecrement(&m_nRefCount);
    };
   
    virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void** ppObj)
    {
        *ppObj = NULL;

        if ((iid == IID_IUnknown) || (iid == IID_IActiveScriptSite))
        {
            *ppObj= (IActiveScriptSite*)this;
            AddRef();
            return S_OK;
        }

        return E_NOINTERFACE;
    }

    virtual HRESULT STDMETHODCALLTYPE GetLCID(LCID __RPC_FAR *)
    {
        return E_NOTIMPL;
    }
   
    virtual HRESULT STDMETHODCALLTYPE GetItemInfo(LPCOLESTR, DWORD, IUnknown __RPC_FAR *__RPC_FAR * pObj, ITypeInfo __RPC_FAR *__RPC_FAR *)
    {
        ASSERT(m_pScripting);
        ASSERT(m_pScripting->GetCodeObject());

        *pObj = m_pScripting->GetCodeObject()->GetIDispatch(TRUE);
        return S_OK;
    }
       
    virtual HRESULT STDMETHODCALLTYPE GetDocVersionString(BSTR __RPC_FAR *)
    {
        return E_NOTIMPL;
    }
       
    virtual HRESULT STDMETHODCALLTYPE OnScriptTerminate(const VARIANT __RPC_FAR * ,const EXCEPINFO __RPC_FAR *)
    {
        return E_NOTIMPL;
    }

       
    virtual HRESULT STDMETHODCALLTYPE OnStateChange(SCRIPTSTATE)
    {
        return E_NOTIMPL;
    }
       
    virtual HRESULT STDMETHODCALLTYPE OnScriptError(IActiveScriptError __RPC_FAR * pScriptError)
    {
        return E_NOTIMPL;
    }
       
    virtual HRESULT STDMETHODCALLTYPE OnEnterScript()
    {
        return E_NOTIMPL;
    }
       
    virtual HRESULT STDMETHODCALLTYPE OnLeaveScript()
    {
        return E_NOTIMPL;
    }

private:
    long m_nRefCount;
    CScriptingSupportHelper* m_pScripting;
};

#include "StdAfx.h"
#include "ScriptingSupport.h"

CCodeObject::CCodeObject(CScriptingSupportHelper* pScripting, CWnd* pWnd)
    : m_pWnd(pWnd),
      m_pScripting(pScripting)

{
    EnableAutomation();
}

CCodeObject::~CCodeObject()
{
}

BEGIN_DISPATCH_MAP(CCodeObject, CCmdTarget)
DISP_FUNCTION_ID(CCodeObject, "Line", idLine, Line, VT_EMPTY, VTS_I4 VTS_I4 VTS_I4 VTS_I4)
DISP_FUNCTION_ID(CCodeObject, "Ellipse", idEllipse, Ellipse, VT_EMPTY, VTS_I4 VTS_I4 VTS_I4 VTS_I4)
DISP_FUNCTION_ID(CCodeObject, "DrawText", idDrawText, DrawText, VT_EMPTY, VTS_BSTR VTS_I4 VTS_I4 VTS_I4 VTS_I4)
END_DISPATCH_MAP()

void CCodeObject::Line(long x1, long y1, long x2, long y2)
{
    CWindowDC dc(m_pWnd);

    dc.MoveTo(x1, y1);
    dc.LineTo(x2, y2);
}

void CCodeObject::Ellipse(long x1, long y1, long x2, long y2)
{
    CWindowDC dc(m_pWnd);
    dc.Ellipse(x1, y1, x2, y2);
}

void CCodeObject::DrawText(LPCTSTR msg, long x, long y, long w, long h)
{
    CWindowDC dc(m_pWnd);
    CRect rect(x, y, x+w, y+h);

    dc.DrawText(msg, rect, 0);
}

void CCodeObject::OnPaint()
{
    COleDispatchDriver disp;
    DISPID dispid;
    if (GetDispatch(L"OnPaint", disp, dispid)) {
        disp.InvokeHelper(dispid, DISPATCH_METHOD, VT_EMPTY, 0, 0);
    }
}

BOOL CCodeObject::GetDispatch(OLECHAR* name, COleDispatchDriver& disp, DISPID& dispid)
{
    IDispatch* pScriptDispatch = 0;
    m_pScripting->GetActiveScript()->GetScriptDispatch(0, &pScriptDispatch);
    disp.AttachDispatch(pScriptDispatch);
    HRESULT hr = pScriptDispatch->GetIDsOfNames(IID_NULL, &name, 1, LOCALE_SYSTEM_DEFAULT, &dispid);
    return SUCCEEDED(hr);
}

void CCodeObject::OnMouseClick(long x, long y)
{
    COleDispatchDriver disp;
    DISPID dispid;
    if (GetDispatch(L"OnMouseClick", disp, dispid)) {
        disp.InvokeHelper(dispid, DISPATCH_METHOD, VT_EMPTY, 0, (const BYTE*)(VTS_I4 VTS_I4), x, y);
    }
}

CScriptingSupportHelper::CScriptingSupportHelper()
    : m_pCodeObject(0),
      m_pScriptSite(0),
      m_pActiveScript(0),
      m_pActiveScriptParse(0)
{
}

CScriptingSupportHelper::~CScriptingSupportHelper()
{
    if (m_pActiveScript)
    {
        m_pActiveScript->Close();
        m_pActiveScriptParse->Release();
        m_pActiveScript->Release();
    }

    delete m_pCodeObject; m_pCodeObject=0;
    delete m_pScriptSite; m_pScriptSite=0;
}

BOOL CScriptingSupportHelper::RunScript(CString strText)
{
    EXCEPINFO ei = {0};
    BSTR bstrText = strText.AllocSysString();
    m_pActiveScriptParse->ParseScriptText(bstrText, NULL, NULL, NULL, 0, 0, 0, NULL, &ei);
    SysFreeString(bstrText);

    m_pActiveScript->SetScriptState(SCRIPTSTATE_CONNECTED);

    return TRUE;
}

BOOL CScriptingSupportHelper::Create(CWnd* pWnd)
{
    m_pCodeObject = new CCodeObject(this, pWnd);
    m_pScriptSite = new CScriptSite(this);

    CLSID clsidJScript;
    CLSIDFromProgID(L"JScript", &clsidJScript);
    CoCreateInstance(clsidJScript, NULL, CLSCTX_INPROC_SERVER, IID_IActiveScript, (void **)&m_pActiveScript);
    m_pActiveScript->QueryInterface(IID_IActiveScriptParse, (void**)&m_pActiveScriptParse);
    m_pActiveScript->SetScriptSite(m_pScriptSite);
    m_pActiveScript->AddNamedItem(L"Code", SCRIPTITEM_ISVISIBLE | SCRIPTITEM_ISSOURCE | SCRIPTITEM_GLOBALMEMBERS);
    m_pActiveScriptParse->InitNew();


    return TRUE;
}




posted @ 2007-11-20 09:19 井泉 閱讀(671) | 評論 (0)編輯 收藏

(msdn)Using MFC to Automate SAPI (SAPI 5.3)http://msdn2.microsoft.com/en-us/library/ms717069.aspx

Microsoft Speech API 5.3   用oleview 可以產生 idl 文件 再用 midl工具 可以產生 tlb,h,c 存根文件 等.

Using MFC to Automate SAPI

Introduction

The Microsoft Foundation Classes (MFC) provides an easy and convenient way to automate calls to SAPI using its Class Wizard to generate wrappers for the SAPI layer from the SAPI Type Library.

In order to accomplish this, perform the following steps:

  1. Create a new MFCAppWizard(exe) project in Visual C++.
  2. Based on the type of application you are creating, follow the wizard prompts. In Step 3 of the wizard prompts, (or Step 2 if you are creating a Dialog Based application) make sure that the Automation check box is selected under the heading, What other support would you like to include?

Once the new project is ready, access Class Wizard.

  1. Click the Automation tab, and then click Add Class and select From a type library in the drop-down list.
  2. Browse for the sapi.dll file and open it.
  3. Select the classes you would like Class Wizard to generate a wrapper for. The resulting default header and implementation files are sapi.h and sapi.cpp respectively. The rest of this document assumes that you have chosen to use these default file names. Click OK.
  4. You should now be back in the Class Wizard window. Click OK.
After you are done with the above steps, Visual C++ will automatically add the Class Wizard generated files sapi.cpp and sapi.h to your project.

Upon viewing the sapi.h file, you should notice that it is nothing more than an automation wrapper that has been generated for all the classes you selected. Notice that all the classes inherit from COleDispatchDriver, hence the dispatch interface needs to be set up. This only requires a few lines of simple code, after which the wrapper class can be used just like any other C++ class.

Example

This example assumes that you chose to generate a wrapper for the ISpeechVoice class from among any other classes you may have selected. Using the project created above, include the sapi.h file within a source file in the project that will make automation calls to SAPI using the wrapper. In that source file, type the following code.

CLSID CLSID_SpVoice;    // class ID for the SAPI SpVoice object
LPDISPATCH pDisp; // dispatch interface for the class
ISpeechVoice voice; // use the MFC Class Wizard generated wrapper

CLSIDFromProgID(L"SAPI.SpVoice", &CLSID;_SpVoice);
voice.CreateDispatch(CLSID_SpVoice);
pDisp = voice.m_lpDispatch;

HRESULT hr = pDisp->QueryInterface(CLSID_SpVoice, (void**)&voice;.m_lpDispatch);

if (hr == S_OK) {
pDisp->Release();
}
else {
voice.AttachDispatch(pDisp, TRUE);
}

voice.Speak("hello world", 1); // asynchronous call to Speak method of ISpeechVoice interface

If you have been following the steps outlined above properly, you should hear your computer say "hello world!" That's all there is to using MFC to make automation calls to SAPI. Currently however, not all the wrapper classes generated by MFC's Class Wizard work properly. For instance, the ISpeechLexicon interface does not work. The work around for this is to implement your own automation wrapper classes using C++. The steps to do that are beyond the scope of this document. Of course, you can always use the COM interfaces in C++ and Automation in Visual Basic to ensure that every interface in SAPI works easily and flawlessly.

posted @ 2007-11-20 09:06 井泉 閱讀(1205) | 評論 (1)編輯 收藏

客戶端調用com

void opercom()
{
    ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
    //    {2D8EBDEE-437C-47c9-ABCC-F169E5E781D0}speeddial
    //    {85140985-7A18-4009-B5FB-43268FD154F8}ISpRecognizerLite
     
        CLSID CLSID_SpVoice;
        ::CLSIDFromProgID(L"SpeedDial", &CLSID_SpVoice);
        LPCLASSFACTORY pClsF;
        LPUNKNOWN punk;                   ::CoGetClassObject(CLSID_SpVoice,CLSCTX_INPROC_SERVER,NULL,IID_IClassFactory,(void**)&pClsF);
        pClsF->CreateInstance(NULL,IID_IUnknown,(void**)&punk);
    punk->QueryInterface(IID_ISpRecognizerLite,(void**)&非抽象類);
    ::CoUninitialize();
}

posted @ 2007-11-20 08:49 井泉 閱讀(309) | 評論 (0)編輯 收藏

(轉)手工注冊com

BOOL regcom(LPCWSTR strLib)
{
    //for registration
    HMODULE hLib = ::LoadLibrary(strLib);
    if(hLib == 0) {
        return FALSE;
    }
    HRESULT (STDAPICALLTYPE *pDllRegisterServer)();
    (FARPROC&)pDllRegisterServer = ::GetProcAddress(hLib, _T("DllRegisterServer"));
    if(pDllRegisterServer == NULL) {  
        ::FreeLibrary(hLib);
        return FALSE;
    }
    if(FAILED(pDllRegisterServer ())) {
        ::FreeLibrary(hLib);
        return FALSE;
    } else {
        ::FreeLibrary(hLib);
        return TRUE;
    }
}

BOOL unregcom(LPCWSTR strLib)
{
    HMODULE hLib = ::LoadLibrary(strLib);
    if(hLib == 0) {
        return FALSE;
    }
    HRESULT (STDAPICALLTYPE *pDllUnregisterServer)();
    (FARPROC&)pDllUnregisterServer = ::GetProcAddress(hLib, _T("DllUnregisterServer"));
    if(pDllUnregisterServer == NULL) {
        ::FreeLibrary(hLib);
        return FALSE;
    }
    if(FAILED(pDllUnregisterServer())) {
        ::FreeLibrary(hLib);
        return FALSE;
    } else {
        ::FreeLibrary(hLib);
        return TRUE;
    }
}


posted @ 2007-11-20 08:48 井泉 閱讀(221) | 評論 (0)編輯 收藏

(轉)Rapi 使用

void CopyFilePCtoWinCE(CString strFileNamePC, CString strFileNamePPC)
{
    CFile oldFile;
    oldFile.Open(strFileNamePC, CFile::modeRead |CFile::typeBinary);
    int iLen = oldFile.GetLength();
    iLen = iLen / BUFFER_SIZE;
    BSTR bstr = strFileNamePPC.AllocSysString();
    SysFreeString(bstr);
    CeRapiInit();
    HANDLE h = CeCreateFile(bstr, GENERIC_READ | GENERIC_WRITE, 0, NULL,
        OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
    char cTemp[BUFFER_SIZE];
    DWORD nbytes;
    int iTotBytes = 0;
    int iReaded=0;
    while((iReaded=oldFile.Read(&cTemp, BUFFER_SIZE)) >= 1)
        CeWriteFile(h, &cTemp, (DWORD)iReaded, &nbytes, NULL);
    CeCloseHandle(h);
    oldFile.Close();
    CeRapiUninit();
}

void CopyFileWinCEtoPC(CString strFileNamePPC, CString strFileNamePC)
{
    BSTR bstr = strFileNamePPC.AllocSysString();
    SysFreeString(bstr);
    CeRapiInit();

    HANDLE h;
    h = CeCreateFile(bstr, GENERIC_READ, FILE_SHARE_READ, NULL,
        OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);

    CFile oldFile;
    oldFile.Open(strFileNamePC, CFile::modeCreate | CFile::modeWrite);

    char cTemp[BUFFER_SIZE];
    DWORD nbytes;
    CString s;

    while(CeReadFile(h, &cTemp, (DWORD)BUFFER_SIZE, &nbytes, NULL) == TRUE)
    {
        oldFile.Write(&cTemp, nbytes);
        if(nbytes < BUFFER_SIZE)
            break;
    }
    CeCloseHandle(h);
    oldFile.Close();
    CeRapiUninit(); 
}

BOOL DeleteFileFromCE(CString strFileNamePPC)
{
    BSTR bstr = strFileNamePPC.AllocSysString();
    SysFreeString(bstr);
    CeRapiInit();
    BOOL bRet = CeDeleteFile(bstr);
    CeRapiUninit();
    return bRet;
}


posted @ 2007-11-20 08:46 井泉 閱讀(1288) | 評論 (0)編輯 收藏

判斷是否有非英文字符

bool HaveNOASCII(LPWSTR str)
{
 char nstring[100]={0};
 wcstombs( nstring,str,100);
 return (strlen(nstring)==wcslen(str));
 
}

posted @ 2007-11-19 16:07 井泉 閱讀(967) | 評論 (1)編輯 收藏

函數對比


用_t
替換字符'w',比如 wcsncpy  to _tcsncpy(自適應函數).

_tcsncpy_l 后綴  _l 不推薦使用的函數

_tcsncpy_s 后綴  _s Security Enhancements in the CRT

_tcsncpy_s_l 后綴  _s_l 同 _s

security enhancements


寬字符處理函數函數與普通函數對照表 
  
 

字符分類:     寬字符函數普通C函數描述 
iswalnum()     isalnum() 測試字符是否為數字或字母 
iswalpha()     isalpha() 測試字符是否是字母 
iswcntrl()     iscntrl() 測試字符是否是控制符 
iswdigit()     isdigit() 測試字符是否為數字 
iswgraph()     isgraph() 測試字符是否是可見字符 
iswlower()     islower() 測試字符是否是小寫字符 
iswprint()     isprint() 測試字符是否是可打印字符 
iswpunct()     ispunct() 測試字符是否是標點符號 
iswspace()     isspace() 測試字符是否是空白符號 
iswupper()     isupper() 測試字符是否是大寫字符 
iswxdigit()     isxdigit()測試字符是否是十六進制的數字 


大小寫轉換:     
寬字符函數    普通C函數描述 
towlower()     tolower() 把字符轉換為小寫 
towupper()     toupper() 把字符轉換為大寫 


字符比較:     寬字符函數普通C函數描述 
wcscoll()     strcoll() 比較字符串 


日期和時間轉換: 
寬字符函數描述 
strftime()     根據指定的字符串格式和locale設置格式化日期和時間 
wcsftime()     根據指定的字符串格式和locale設置格式化日期和時間, 并返回寬字符串 
strptime()     根據指定格式把字符串轉換為時間值, 是strftime的反過程 


打印和掃描字符串: 
寬字符函數描述 
fprintf()
/fwprintf()     使用vararg參量的格式化輸出 
fscanf()
/fwscanf()         格式化讀入 
printf()             使用vararg參量的格式化輸出到標準輸出 
scanf()             從標準輸入的格式化讀入 
sprintf()
/swprintf()     根據vararg參量表格式化成字符串 
sscanf()             以字符串作格式化讀入 
vfprintf()
/vfwprintf()     使用stdarg參量表格式化輸出到文件 
vprintf()             使用stdarg參量表格式化輸出到標準輸出 
vsprintf()
/vswprintf()     格式化stdarg參量表并寫到字符串 


數字轉換: 
寬字符函數    普通C函數描述 
wcstod()     strtod()  把寬字符的初始部分轉換為雙精度浮點數 
wcstol()     strtol()  把寬字符的初始部分轉換為長整數 
wcstoul()     strtoul() 把寬字符的初始部分轉換為無符號長整數 


多字節字符和寬字符轉換及操作: 
寬字符函數描述 
mblen()         根據locale的設置確定字符的字節數 
mbstowcs()         把多字節字符串轉換為寬字符串 
mbtowc()
/btowc()    把多字節字符轉換為寬字符 
wcstombs()         把寬字符串轉換為多字節字符串 
wctomb()
/wctob()     把寬字符轉換為多字節字符 


輸入和輸出: 
寬字符函數    普通C函數描述 
fgetwc()     fgetc()     從流中讀入一個字符并轉換為寬字符 
fgetws()     fgets()     從流中讀入一個字符串并轉換為寬字符串 
fputwc()     fputc()     把寬字符轉換為多字節字符并且輸出到標準輸出 
fputws()     fputs()     把寬字符串轉換為多字節字符并且輸出到標準輸出串 
getwc()     getc()     從標準輸入中讀取字符, 并且轉換為寬字符 
getwchar()     getchar()     從標準輸入中讀取字符, 并且轉換為寬字符 
None         gets()     使用fgetws() 
putwc()     putc()     把寬字符轉換成多字節字符并且寫到標準輸出 
putwchar()     putchar()     把寬字符轉換成多字節字符并且寫到標準輸出 
None         puts()     使用fputws() 
ungetwc()     ungetc()     把一個寬字符放回到輸入流中 


字符串操作: 
寬字符函數        普通C函數描述 
wcscat()         strcat()     把一個字符串接到另一個字符串的尾部 
wcsncat()         strncat()     類似于wcscat(), 而且指定粘接字符串的粘接長度. 
wcschr()         strchr()     查找子字符串的第一個位置 
wcsrchr()         strrchr()     從尾部開始查找子字符串出現的第一個位置 
wcspbrk()         strpbrk()     從一字符字符串中查找另一字符串中任何一個字符第一次出現的位置 
wcswcs()
/wcsstr()     strchr()     在一字符串中查找另一字符串第一次出現的位置 
wcscspn()         strcspn()     返回不包含第二個字符串的的初始數目 
wcsspn()         strspn()     返回包含第二個字符串的初始數目 
wcscpy()         strcpy()     拷貝字符串 
wcsncpy()         strncpy()     類似于wcscpy(), 同時指定拷貝的數目 
wcscmp()         strcmp()     比較兩個寬字符串 
wcsncmp()         strncmp()     類似于wcscmp(), 還要指定比較字符字符串的數目 
wcslen()         strlen()     獲得寬字符串的數目 
wcstok()         strtok()     根據標示符把寬字符串分解成一系列字符串 
wcswidth()         None         獲得寬字符串的寬度 
wcwidth()         None         獲得寬字符的寬度 


另外還有對應于memory操作的 wmemcpy(), wmemchr(), wmemcmp(), wmemmove(), wmemset().

posted @ 2007-11-19 10:25 井泉 閱讀(1401) | 評論 (0)編輯 收藏

IBasicVideo::GetCurrentImage 抓圖

http://www.geekpage.jp/en/programming/directshow/getcurrentimage.php

#include <stdio.h>
#include <dshow.h>
// change here
#define	FILENAME L"C:\\DXSDK\\Samples\\Media\\butterfly.mpg"
// note that this sample fails on some environment
int
main()
{
IGraphBuilder *pGraphBuilder;
IMediaControl *pMediaControl;
IBasicVideo *pBasicVideo;
CoInitialize(NULL);
CoCreateInstance(CLSID_FilterGraph,
NULL,
CLSCTX_INPROC,
IID_IGraphBuilder,
(LPVOID *)&pGraphBuilder);
pGraphBuilder->QueryInterface(IID_IMediaControl,
(LPVOID *)&pMediaControl);
pMediaControl->RenderFile(FILENAME);

pGraphBuilder->QueryInterface(IID_IBasicVideo,
(LPVOID *)&pBasicVideo);

pMediaControl->Run();
// The image will be saved when OK is clicked
MessageBox(NULL,
"Grab Image",
"Grab",
MB_OK);

// Must Pause before using GetCurrentImage
pMediaControl->Pause();
// get width and height
long height, width;
pBasicVideo->get_VideoHeight(&height);
pBasicVideo->get_VideoWidth(&width);
long bufSize;
long *imgData;
HRESULT hr;
/*
The second value is NULL to resolve required buffer size.
The required buffer size will be returned in variable "bufSize".
*/
hr = pBasicVideo->GetCurrentImage(&bufSize, NULL);
if (FAILED(hr)) {
printf("GetCurrentImage failed\n");
return 1;
}
if (bufSize < 1) {
printf("failed to get data size\n");
return 1;
}
imgData = (long *)malloc(bufSize);
// The data will be in DIB format
pBasicVideo->GetCurrentImage(&bufSize, imgData);

// save DIB file as Bitmap.
// This sample saves image as bitmap to help
// understanding the sample.
HANDLE fh;
BITMAPFILEHEADER bmphdr;
BITMAPINFOHEADER bmpinfo;
DWORD nWritten;
memset(&bmphdr, 0, sizeof(bmphdr));
memset(&bmpinfo, 0, sizeof(bmpinfo));
bmphdr.bfType = ('M' << 8) | 'B';
bmphdr.bfSize = sizeof(bmphdr) + sizeof(bmpinfo) + bufSize;
bmphdr.bfOffBits = sizeof(bmphdr) + sizeof(bmpinfo);
bmpinfo.biSize = sizeof(bmpinfo);
bmpinfo.biWidth = width;
bmpinfo.biHeight = height;
bmpinfo.biPlanes = 1;
bmpinfo.biBitCount = 32;
fh = CreateFile("result.bmp",
GENERIC_WRITE, 0, NULL,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
WriteFile(fh, &bmphdr, sizeof(bmphdr), &nWritten, NULL);
WriteFile(fh, &bmpinfo, sizeof(bmpinfo), &nWritten, NULL);
WriteFile(fh, imgData, bufSize, &nWritten, NULL);
CloseHandle(fh);

free(imgData);
// Release resource
pBasicVideo->Release();

pMediaControl->Release();
pGraphBuilder->Release();
CoUninitialize();
return 0;
}

posted @ 2007-11-19 08:40 井泉 閱讀(3591) | 評論 (0)編輯 收藏

wince 物理地址訪問二

You can use functions that are exposed by the WDbgExts_CE.h header file in debugger extension commands. When developing a debugger extension, these functions can be helpful in controlling and examining the target device being debugged.

The following table shows debugger extension functions.

Programming element Description

CheckControlC

This function checks to see whether the user pressed the CTRL+C key combination.

Disassm

This function disassembles an instruction and stores in a buffer a string that can be printed.

dprintf

This function prints a formatted string to the command window for the debugger.

EXTSTACKTRACE

This structure specifies stack frames for the StackTrace function.

GetContext

This function obtains the context of the process being debugged.

GetDebuggerData

This function retrieves information stored in a data block.

GetExpression

This function returns the value of an expression.

GetSetSympath

This function obtains or sets the search path for symbols.

GetSymbol

This function locates the symbol nearest to a specified address.

Ioctl

This function is an entry point for much of the functionality provided by the extension functions for the kernel debugger.

ReadControlSpace

This function reads a CPU-specific control space into an array.

ReadMemory

This function reads memory from the process being debugged.

The entire area of memory must be accessible, or the operation fails.

ReadPhysical

This function reads from physical memory.

SetContext

This function sets the context of the process being debugged.

SetThreadForOperation

This function specifies a thread to use for the next call to the StackTrace function

StackTrace

This function receives a stack trace for the process being debugged.

WriteIoSpace

This function writes to system I/O locations.

WriteMemory

This function writes memory to a process being debugged.

The entire area of memory must be accessible, or the operation fails.

WritePhysical

This function writes to physical memory.

posted @ 2007-11-15 12:47 井泉 閱讀(324) | 評論 (1)編輯 收藏

僅列出標題
共8頁: 1 2 3 4 5 6 7 8 
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            一区二区久久久久| 先锋影音一区二区三区| 一区二区日韩| 亚洲国产三级网| 亚洲福利国产精品| 亚洲国产欧洲综合997久久| 国产一区清纯| 亚洲福利视频一区| 亚洲精品一级| 亚洲免费视频网站| 久久久水蜜桃| 免费观看国产成人| 亚洲人成7777| 亚洲第一视频| 日韩视频在线免费| 欧美一级大片在线观看| 另类图片国产| 欧美日韩的一区二区| 国产精品毛片a∨一区二区三区|国| 国产精品第一页第二页第三页| 国产精品伦理| 在线日韩精品视频| 在线午夜精品| 亚洲精品中文字| 亚洲一区二区高清| 久久久www成人免费精品| 久久久久久国产精品mv| 亚洲精品视频啊美女在线直播| 中文欧美字幕免费| 久久久亚洲精品一区二区三区 | 99精品视频免费观看视频| 亚洲午夜精品久久久久久浪潮| 午夜久久电影网| 免费观看在线综合色| 国产精品久久久一区二区| 伊人成年综合电影网| 亚洲视频在线视频| 欧美大片免费| 欧美一级专区免费大片| 欧美激情综合五月色丁香| 国产一区二区三区在线观看精品| 亚洲激情影院| 久久综合一区| 欧美亚洲一区在线| 欧美午夜精品理论片a级按摩| 激情成人综合网| 香蕉久久国产| 夜夜夜久久久| 欧美激情乱人伦| 亚洲大胆女人| 久久五月天婷婷| 午夜在线精品偷拍| 国产乱码精品一区二区三区av| 国产精品99久久久久久有的能看| 欧美激情自拍| 欧美777四色影视在线| 极品少妇一区二区| 另类av一区二区| 久久九九国产| 精品不卡视频| 久久亚洲国产精品日日av夜夜| 亚洲欧美日韩国产综合在线| 欧美性做爰毛片| 亚洲午夜精品一区二区三区他趣| 亚洲区在线播放| 欧美日韩国产亚洲一区| 一道本一区二区| 日韩亚洲欧美精品| 欧美手机在线视频| 亚洲欧美中文另类| 性亚洲最疯狂xxxx高清| 国产综合色一区二区三区| 久久久久国产精品www| 欧美在线电影| 亚洲高清三级视频| 亚洲激情视频在线观看| 欧美日韩国产在线播放网站| 亚洲私拍自拍| 亚洲欧美日韩在线不卡| 欧美在线播放高清精品| 这里只有精品视频| 欧美私人网站| 久久精品国产久精国产一老狼| 午夜精品久久久久久 | 在线色欧美三级视频| 蜜桃av一区二区三区| 久久视频在线免费观看| 亚洲欧洲在线播放| 亚洲精品日本| 国产美女精品| 久久一区激情| 欧美绝品在线观看成人午夜影视 | 久久米奇亚洲| 免费观看成人鲁鲁鲁鲁鲁视频 | 美女露胸一区二区三区| 欧美国产综合视频| 亚洲欧美日韩国产一区| 久久久视频精品| 亚洲最新视频在线| 欧美在线免费观看| 夜夜爽99久久国产综合精品女不卡 | 免费成人黄色片| 亚洲午夜小视频| 久久久xxx| 亚洲一级在线| 久久蜜桃精品| 亚洲砖区区免费| 免播放器亚洲一区| 亚洲欧美综合v| 欧美成人午夜激情| 香蕉久久国产| 欧美日韩国产黄| 免费精品99久久国产综合精品| 欧美激情一区在线| 久久婷婷国产麻豆91天堂| 欧美亚日韩国产aⅴ精品中极品| 免费看的黄色欧美网站| 国产精品毛片| 亚洲欧洲日产国产网站| 狠狠色丁香久久婷婷综合丁香| 亚洲理论在线观看| 亚洲国产精品欧美一二99| 午夜综合激情| 午夜精品久久久久| 欧美三级电影一区| 亚洲成色最大综合在线| 国产嫩草一区二区三区在线观看| 亚洲国产成人精品女人久久久| 国产情侣一区| 亚洲一二三四区| 亚洲一区二区黄| 欧美日韩日本国产亚洲在线 | 久久一区二区视频| 国产中文一区二区| 午夜精品在线观看| 久久久av水蜜桃| 国产一区视频在线观看免费| 久久精品卡一| 欧美成人a∨高清免费观看| 国产精品入口福利| 中文av字幕一区| 亚洲综合色丁香婷婷六月图片| 欧美日韩成人在线视频| 亚洲日本va在线观看| 亚洲美女黄色| 欧美精品一区二区三区四区| 亚洲国内精品| 99re6热只有精品免费观看| 嫩草成人www欧美| 欧美福利一区二区| 亚洲精选在线| 欧美无砖砖区免费| 亚洲一区国产| 久久一区二区精品| 亚洲激情自拍| 欧美日韩国产成人| 亚洲一区二区精品在线观看| 亚洲欧美欧美一区二区三区| 国产欧美一区在线| 久久久久国产精品厨房| 欧美成人午夜激情| 99精品国产99久久久久久福利| 欧美日韩在线播放一区| 亚洲伊人网站| 久久亚洲不卡| 一区二区日韩免费看| 国产精品久久中文| 久久国产一区| 欧美成人自拍| 亚洲愉拍自拍另类高清精品| 国产日产欧产精品推荐色 | 久久综合久色欧美综合狠狠| 欧美成人资源| 亚洲综合电影一区二区三区| 国产美女精品视频免费观看| 久久精品亚洲一区二区| 欧美大片免费观看在线观看网站推荐| 亚洲最新在线视频| 国产精品主播| 免费高清在线视频一区·| 日韩一级网站| 鲁大师影院一区二区三区| 一区二区免费看| 精品动漫3d一区二区三区免费 | 午夜在线成人av| 亚洲激情在线观看| 久久久久久69| 亚洲免费视频观看| 亚洲精品国产拍免费91在线| 国产女优一区| 欧美日韩一区二区三区四区五区 | 国产精自产拍久久久久久蜜| 免费短视频成人日韩| 欧美一区二区在线免费播放| 亚洲欧洲日产国产综合网| 久久久久久久久综合| 久久中文字幕一区| 久久久久久综合| 亚洲精品国产拍免费91在线| 久久久久网址|