messages
listlengths
1
1
topic
stringlengths
2
60
[ { "date": "2016-08-24", "forum": "FiveWin for Harbour/xHarbour", "text": "OK but I haven't had Borland installed here for many years so I can't really help.", "time": "23:21", "topic": "Camera Control needed for Tablet", "username": "TimStone" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-24", "forum": "FiveWin for Harbour/xHarbour", "text": "Tim,\n\nThis version works fine with MSVC. This is a work in progress.\n\nYou have to link MS strmiids.lib\n\n[code=fw:1flygou0]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><span style=\"color: #00D7D7;\">#include</span> <span style=\"color: #ff0000;\">\"FiveWin.ch\"</span><br /><br /><span style=\"color: #00C800;\">function</span> Main<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br /><br />&nbsp; &nbsp;DShowCamera<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br /><br /><span style=\"color: #00C800;\">return</span> <span style=\"color: #00C800;\">nil</span><br /><br /><span style=\"color: #00D7D7;\">#pragma</span> BEGINDUMP<br /><br /><span style=\"color: #00D7D7;\">#include</span> <dshow.h><br /><span style=\"color: #00D7D7;\">#include</span> <uuids.h><br /><span style=\"color: #00D7D7;\">#include</span> <objbase.h><br /><br /><span style=\"color: #00C800;\">HB_FUNC</span><span style=\"color: #000000;\">&#40;</span> DSHOWCAMERA <span style=\"color: #000000;\">&#41;</span><br /><span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp;HRESULT hr;<br />&nbsp; &nbsp;ICreateDevEnum *pDevEnum = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IEnumMoniker *pEnum = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IMoniker *pMoniker = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IPropertyBag *pPropBag = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IGraphBuilder *pGraph = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;ICaptureGraphBuilder2 *pBuilder = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pCap = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pSampleGrabberFilter = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pNullRenderer = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IMediaControl *pMediaControl = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;char *pBuffer = <span style=\"color: #00C800;\">NULL</span>;<br /><br />&nbsp; &nbsp;hr = CoInitializeEx<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #00C800;\">NULL</span>, COINIT_MULTITHREADED <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoInitializeEx error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_FilterGraph, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_IGraphBuilder,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span> void ** <span style=\"color: #000000;\">&#41;</span> &pGraph <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoCreateInstance error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> pGraph != <span style=\"color: #00C800;\">NULL</span> <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"pGraph seems ok\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_CaptureGraphBuilder2, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_ICaptureGraphBuilder2,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span> void ** <span style=\"color: #000000;\">&#41;</span> &pBuilder <span style=\"color: #000000;\">&#41;</span>; &nbsp; &nbsp; &nbsp;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoCreateInstance 2 error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> pBuilder != <span style=\"color: #00C800;\">NULL</span> <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"pBuilder seems ok\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = <span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">&#40;</span> ICaptureGraphBuilder * <span style=\"color: #000000;\">&#41;</span> pBuilder <span style=\"color: #000000;\">&#41;</span>->SetFiltergraph<span style=\"color: #000000;\">&#40;</span> pGraph <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not attach capture graph builder to graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; <br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_SystemDeviceEnum, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span> &pDevEnum <span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not crerate system device enumerator\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; &nbsp; &nbsp; &nbsp;<br /><span style=\"color: #000000;\">&#125;</span><br /><br /><span style=\"color: #00D7D7;\">#pragma</span> ENDDUMP</div>[/code:1flygou0]", "time": "23:22", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-24", "forum": "FiveWin for Harbour/xHarbour", "text": "I appreciate if you can test it on your tablet.\n\nIt does nothing yet. We are just converting code, step by step.", "time": "23:24", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-24", "forum": "FiveWin for Harbour/xHarbour", "text": "I am going to code it for MSVC so you can help me to test it <!-- s:-) --><img src=\"{SMILIES_PATH}/icon_smile.gif\" alt=\":-)\" title=\"Smile\" /><!-- s:-) -->", "time": "23:25", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-24", "forum": "FiveWin for Harbour/xHarbour", "text": "This version should report the camera name:\n\n[code=fw:1xa9s71f]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><span style=\"color: #00D7D7;\">#include</span> <span style=\"color: #ff0000;\">\"FiveWin.ch\"</span><br /><br /><span style=\"color: #00C800;\">function</span> Main<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br /><br />&nbsp; &nbsp;DShowCamera<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br /><br /><span style=\"color: #00C800;\">return</span> <span style=\"color: #00C800;\">nil</span><br /><br /><span style=\"color: #00D7D7;\">#pragma</span> BEGINDUMP<br /><br /><span style=\"color: #00D7D7;\">#include</span> <dshow.h><br /><span style=\"color: #00D7D7;\">#include</span> <uuids.h><br /><span style=\"color: #00D7D7;\">#include</span> <objbase.h><br /><br /><span style=\"color: #00C800;\">HB_FUNC</span><span style=\"color: #000000;\">&#40;</span> DSHOWCAMERA <span style=\"color: #000000;\">&#41;</span><br /><span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp;HRESULT hr;<br />&nbsp; &nbsp;ICreateDevEnum *pDevEnum = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IEnumMoniker *pEnum = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IMoniker *pMoniker = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IPropertyBag *pPropBag = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IGraphBuilder *pGraph = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;ICaptureGraphBuilder2 *pBuilder = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pCap = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pSampleGrabberFilter = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pNullRenderer = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IMediaControl *pMediaControl = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;char *pBuffer = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;VARIANT <span style=\"color: #0000ff;\">var</span>;<br />&nbsp; &nbsp; int n = <span style=\"color: #000000;\">0</span>;<br />&nbsp; &nbsp; int device_number = <span style=\"color: #000000;\">0</span>;<br />&nbsp; &nbsp; char device_name<span style=\"color: #000000;\">&#91;</span> <span style=\"color: #000000;\">100</span> <span style=\"color: #000000;\">&#93;</span>;<br />&nbsp; &nbsp;char char_buffer<span style=\"color: #000000;\">&#91;</span><span style=\"color: #000000;\">100</span><span style=\"color: #000000;\">&#93;</span>;<br /><br />&nbsp; &nbsp;strcpy<span style=\"color: #000000;\">&#40;</span> device_name, <span style=\"color: #ff0000;\">\"\"</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;hr = CoInitializeEx<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #00C800;\">NULL</span>, COINIT_MULTITHREADED <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoInitializeEx error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_FilterGraph, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_IGraphBuilder,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span> void ** <span style=\"color: #000000;\">&#41;</span> &pGraph <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoCreateInstance error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> pGraph != <span style=\"color: #00C800;\">NULL</span> <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"pGraph seems ok\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_CaptureGraphBuilder2, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_ICaptureGraphBuilder2,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span> void ** <span style=\"color: #000000;\">&#41;</span> &pBuilder <span style=\"color: #000000;\">&#41;</span>; &nbsp; &nbsp; &nbsp;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoCreateInstance 2 error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> pBuilder != <span style=\"color: #00C800;\">NULL</span> <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"pBuilder seems ok\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = <span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">&#40;</span> ICaptureGraphBuilder * <span style=\"color: #000000;\">&#41;</span> pBuilder <span style=\"color: #000000;\">&#41;</span>->SetFiltergraph<span style=\"color: #000000;\">&#40;</span> pGraph <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not attach capture graph builder to graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; <br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_SystemDeviceEnum, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span> &pDevEnum <span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not crerate system device enumerator\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = pDevEnum->CreateClassEnumerator<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSID_VideoInputDeviceCategory, &pEnum, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"No video devices found\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; <span style=\"color: #00C800;\">while</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span><span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Access next device</span><br />&nbsp; &nbsp; &nbsp; &nbsp; hr = pEnum->Next<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span>, &pMoniker, <span style=\"color: #00C800;\">NULL</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr == S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; n++; <span style=\"color: #B900B9;\">// increment device count</span><br />&nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// If device was specified by name rather than number...</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> device_number == <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get video input device name</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hr = pMoniker->BindToStorage<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span>&pPropBag<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr == S_OK<span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get current device name</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VariantInit<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hr = pPropBag->Read<span style=\"color: #000000;\">&#40;</span>L<span style=\"color: #ff0000;\">\"FriendlyName\"</span>, &var, <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Convert to a normal C string, i.e. char*</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sprintf<span style=\"color: #000000;\">&#40;</span>char_buffer, <span style=\"color: #ff0000;\">\"%ls\"</span>, <span style=\"color: #0000ff;\">var</span>.bstrVal<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VariantClear<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pPropBag->Release<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pPropBag = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Exit loop if current device name matched devname</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, char_buffer, <span style=\"color: #ff0000;\">\"device_name\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span><span style=\"color: #0000ff;\">strcmp</span><span style=\"color: #000000;\">&#40;</span>device_name, char_buffer<span style=\"color: #000000;\">&#41;</span> == <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Error getting device names\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #000000;\">&#125;</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span> <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>n >= device_number<span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span> &nbsp; &nbsp; &nbsp;<br /><span style=\"color: #000000;\">&#125;</span><br /><br /><span style=\"color: #00D7D7;\">#pragma</span> ENDDUMP</div>[/code:1xa9s71f]", "time": "23:42", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-24", "forum": "FiveWin for Harbour/xHarbour", "text": "More\n\nYou will get two warnings with verbose info that you can safely ignore\n\n[code=fw:16co49b4]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><span style=\"color: #00D7D7;\">#include</span> <span style=\"color: #ff0000;\">\"FiveWin.ch\"</span><br /><br /><span style=\"color: #00C800;\">function</span> Main<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br /><br />&nbsp; &nbsp;DShowCamera<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br /><br /><span style=\"color: #00C800;\">return</span> <span style=\"color: #00C800;\">nil</span><br /><br /><span style=\"color: #00D7D7;\">#pragma</span> BEGINDUMP<br /><br /><span style=\"color: #00D7D7;\">#include</span> <dshow.h><br /><span style=\"color: #00D7D7;\">#include</span> <uuids.h><br /><span style=\"color: #00D7D7;\">#include</span> <objbase.h><br /><br />#import <span style=\"color: #ff0000;\">\"qedit.dll\"</span> raw_interfaces_only named_guids<br /><br />EXTERN_C const CLSID CLSID_NullRenderer;<br />EXTERN_C const CLSID CLSID_SampleGrabber;<br /><br /><span style=\"color: #00C800;\">HB_FUNC</span><span style=\"color: #000000;\">&#40;</span> DSHOWCAMERA <span style=\"color: #000000;\">&#41;</span><br /><span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp;HRESULT hr;<br />&nbsp; &nbsp;ICreateDevEnum *pDevEnum = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IEnumMoniker *pEnum = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IMoniker *pMoniker = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IPropertyBag *pPropBag = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IGraphBuilder *pGraph = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;ICaptureGraphBuilder2 *pBuilder = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pCap = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pSampleGrabberFilter = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pNullRenderer = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IMediaControl *pMediaControl = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;char *pBuffer = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;VARIANT <span style=\"color: #0000ff;\">var</span>;<br />&nbsp; &nbsp; int n = <span style=\"color: #000000;\">0</span>;<br />&nbsp; &nbsp; int device_number = <span style=\"color: #000000;\">0</span>;<br />&nbsp; &nbsp; char device_name<span style=\"color: #000000;\">&#91;</span> <span style=\"color: #000000;\">100</span> <span style=\"color: #000000;\">&#93;</span>;<br />&nbsp; &nbsp;char char_buffer<span style=\"color: #000000;\">&#91;</span><span style=\"color: #000000;\">100</span><span style=\"color: #000000;\">&#93;</span>;<br />&nbsp; &nbsp;DexterLib::<span style=\"color: #000000;\">ISampleGrabber</span> *pSampleGrabber = <span style=\"color: #00C800;\">NULL</span>;<br /><br />&nbsp; &nbsp;strcpy<span style=\"color: #000000;\">&#40;</span> device_name, <span style=\"color: #ff0000;\">\"\"</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;hr = CoInitializeEx<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #00C800;\">NULL</span>, COINIT_MULTITHREADED <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoInitializeEx error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_FilterGraph, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_IGraphBuilder,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span> void ** <span style=\"color: #000000;\">&#41;</span> &pGraph <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoCreateInstance error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> pGraph != <span style=\"color: #00C800;\">NULL</span> <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"pGraph seems ok\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_CaptureGraphBuilder2, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_ICaptureGraphBuilder2,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span> void ** <span style=\"color: #000000;\">&#41;</span> &pBuilder <span style=\"color: #000000;\">&#41;</span>; &nbsp; &nbsp; &nbsp;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoCreateInstance 2 error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> pBuilder != <span style=\"color: #00C800;\">NULL</span> <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"pBuilder seems ok\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = <span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">&#40;</span> ICaptureGraphBuilder * <span style=\"color: #000000;\">&#41;</span> pBuilder <span style=\"color: #000000;\">&#41;</span>->SetFiltergraph<span style=\"color: #000000;\">&#40;</span> pGraph <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not attach capture graph builder to graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; <br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_SystemDeviceEnum, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span> &pDevEnum <span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not crerate system device enumerator\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = pDevEnum->CreateClassEnumerator<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSID_VideoInputDeviceCategory, &pEnum, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"No video devices found\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; <span style=\"color: #00C800;\">while</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span><span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Access next device</span><br />&nbsp; &nbsp; &nbsp; &nbsp; hr = pEnum->Next<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span>, &pMoniker, <span style=\"color: #00C800;\">NULL</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr == S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; n++; <span style=\"color: #B900B9;\">// increment device count</span><br />&nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// If device was specified by name rather than number...</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> device_number == <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get video input device name</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hr = pMoniker->BindToStorage<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span>&pPropBag<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr == S_OK<span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get current device name</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VariantInit<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hr = pPropBag->Read<span style=\"color: #000000;\">&#40;</span>L<span style=\"color: #ff0000;\">\"FriendlyName\"</span>, &var, <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Convert to a normal C string, i.e. char*</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sprintf<span style=\"color: #000000;\">&#40;</span>char_buffer, <span style=\"color: #ff0000;\">\"%ls\"</span>, <span style=\"color: #0000ff;\">var</span>.bstrVal<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VariantClear<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pPropBag->Release<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pPropBag = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Exit loop if current device name matched devname</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, char_buffer, <span style=\"color: #ff0000;\">\"device_name\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span><span style=\"color: #0000ff;\">strcmp</span><span style=\"color: #000000;\">&#40;</span>device_name, char_buffer<span style=\"color: #000000;\">&#41;</span> == <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Error getting device names\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #000000;\">&#125;</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span> <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>n >= device_number<span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span> &nbsp; <br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get video input device name</span><br />&nbsp; &nbsp; hr = pMoniker->BindToStorage<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span>&pPropBag<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; VariantInit<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; hr = pPropBag->Read<span style=\"color: #000000;\">&#40;</span>L<span style=\"color: #ff0000;\">\"FriendlyName\"</span>, &var, <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; MessageBoxW<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, L<span style=\"color: #ff0000;\">\"Capture device\"</span>, <span style=\"color: #0000ff;\">var</span>.bstrVal, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; VariantClear<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>; &nbsp; <br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Create capture filter and add to graph</span><br />&nbsp; &nbsp; hr = pMoniker->BindToObject<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IID_IBaseFilter, <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pCap<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span> <br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not create capture filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; &nbsp; <br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Add capture filter to graph</span><br />&nbsp; &nbsp; hr = pGraph->AddFilter<span style=\"color: #000000;\">&#40;</span>pCap, L<span style=\"color: #ff0000;\">\"Capture Filter\"</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span> <br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not add capture filter to graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Create sample grabber filter</span><br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span>CLSID_SampleGrabber, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_IBaseFilter,<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pSampleGrabberFilter<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not create Sample Grabber filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Query the ISampleGrabber interface of the sample grabber filter</span><br />&nbsp; &nbsp; hr = pSampleGrabberFilter->QueryInterface<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DexterLib::<span style=\"color: #000000;\">IID_ISampleGrabber</span>, <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pSampleGrabber<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not get ISampleGrabber interface to sample grabber filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"done\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; &nbsp; <br /><span style=\"color: #000000;\">&#125;</span><br /><br /><span style=\"color: #00D7D7;\">#pragma</span> ENDDUMP</div>[/code:16co49b4]", "time": "23:52", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "Tried building that with MSVC and get at least 102 errors ...", "time": "00:06", "topic": "Camera Control needed for Tablet", "username": "TimStone" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "This version shows the camara window <!-- s:-) --><img src=\"{SMILIES_PATH}/icon_smile.gif\" alt=\":-)\" title=\"Smile\" /><!-- s:-) -->\n\n[code=fw:fgmm2z0l]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><span style=\"color: #00D7D7;\">#include</span> <span style=\"color: #ff0000;\">\"FiveWin.ch\"</span><br /><br /><span style=\"color: #00C800;\">function</span> Main<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br /><br />&nbsp; &nbsp;DShowCamera<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br /><br /><span style=\"color: #00C800;\">return</span> <span style=\"color: #00C800;\">nil</span><br /><br /><span style=\"color: #00D7D7;\">#pragma</span> BEGINDUMP<br /><br /><span style=\"color: #00D7D7;\">#include</span> <dshow.h><br /><span style=\"color: #00D7D7;\">#include</span> <uuids.h><br /><span style=\"color: #00D7D7;\">#include</span> <objbase.h><br /><br />#import <span style=\"color: #ff0000;\">\"qedit.dll\"</span> raw_interfaces_only named_guids<br /><br />EXTERN_C const CLSID CLSID_NullRenderer;<br />EXTERN_C const CLSID CLSID_SampleGrabber;<br /><br /><span style=\"color: #00C800;\">HB_FUNC</span><span style=\"color: #000000;\">&#40;</span> DSHOWCAMERA <span style=\"color: #000000;\">&#41;</span><br /><span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp;HRESULT hr;<br />&nbsp; &nbsp;ICreateDevEnum *pDevEnum = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IEnumMoniker *pEnum = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IMoniker *pMoniker = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IPropertyBag *pPropBag = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IGraphBuilder *pGraph = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;ICaptureGraphBuilder2 *pBuilder = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pCap = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pSampleGrabberFilter = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pNullRenderer = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IMediaControl *pMediaControl = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;char *pBuffer = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;VARIANT <span style=\"color: #0000ff;\">var</span>;<br />&nbsp; &nbsp; int n = <span style=\"color: #000000;\">0</span>;<br />&nbsp; &nbsp; int device_number = <span style=\"color: #000000;\">0</span>;<br />&nbsp; &nbsp; char device_name<span style=\"color: #000000;\">&#91;</span> <span style=\"color: #000000;\">100</span> <span style=\"color: #000000;\">&#93;</span>;<br />&nbsp; &nbsp;char char_buffer<span style=\"color: #000000;\">&#91;</span><span style=\"color: #000000;\">100</span><span style=\"color: #000000;\">&#93;</span>;<br />&nbsp; &nbsp;DexterLib::<span style=\"color: #000000;\">ISampleGrabber</span> *pSampleGrabber = <span style=\"color: #00C800;\">NULL</span>;<br /><br />&nbsp; &nbsp;strcpy<span style=\"color: #000000;\">&#40;</span> device_name, <span style=\"color: #ff0000;\">\"\"</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;hr = CoInitializeEx<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #00C800;\">NULL</span>, COINIT_MULTITHREADED <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoInitializeEx error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_FilterGraph, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_IGraphBuilder,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span> void ** <span style=\"color: #000000;\">&#41;</span> &pGraph <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoCreateInstance error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_CaptureGraphBuilder2, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_ICaptureGraphBuilder2,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span> void ** <span style=\"color: #000000;\">&#41;</span> &pBuilder <span style=\"color: #000000;\">&#41;</span>; &nbsp; &nbsp; &nbsp;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoCreateInstance 2 error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; hr = <span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">&#40;</span> ICaptureGraphBuilder * <span style=\"color: #000000;\">&#41;</span> pBuilder <span style=\"color: #000000;\">&#41;</span>->SetFiltergraph<span style=\"color: #000000;\">&#40;</span> pGraph <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not attach capture graph builder to graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; <br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_SystemDeviceEnum, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span> &pDevEnum <span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not crerate system device enumerator\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = pDevEnum->CreateClassEnumerator<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSID_VideoInputDeviceCategory, &pEnum, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"No video devices found\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; <span style=\"color: #00C800;\">while</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span><span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Access next device</span><br />&nbsp; &nbsp; &nbsp; &nbsp; hr = pEnum->Next<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span>, &pMoniker, <span style=\"color: #00C800;\">NULL</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr == S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; n++; <span style=\"color: #B900B9;\">// increment device count</span><br />&nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// If device was specified by name rather than number...</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> device_number == <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get video input device name</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hr = pMoniker->BindToStorage<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span>&pPropBag<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr == S_OK<span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get current device name</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VariantInit<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hr = pPropBag->Read<span style=\"color: #000000;\">&#40;</span>L<span style=\"color: #ff0000;\">\"FriendlyName\"</span>, &var, <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Convert to a normal C string, i.e. char*</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sprintf<span style=\"color: #000000;\">&#40;</span>char_buffer, <span style=\"color: #ff0000;\">\"%ls\"</span>, <span style=\"color: #0000ff;\">var</span>.bstrVal<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VariantClear<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pPropBag->Release<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pPropBag = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Exit loop if current device name matched devname</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// MessageBox( 0, char_buffer, \"device_name\", 0 );</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span><span style=\"color: #0000ff;\">strcmp</span><span style=\"color: #000000;\">&#40;</span>device_name, char_buffer<span style=\"color: #000000;\">&#41;</span> == <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Error getting device names\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #000000;\">&#125;</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span> <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>n >= device_number<span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span> &nbsp; <br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get video input device name</span><br />&nbsp; &nbsp; hr = pMoniker->BindToStorage<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span>&pPropBag<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; VariantInit<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; hr = pPropBag->Read<span style=\"color: #000000;\">&#40;</span>L<span style=\"color: #ff0000;\">\"FriendlyName\"</span>, &var, <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// MessageBoxW( 0, L\"Capture device\", var.bstrVal, 0 );</span><br />&nbsp; &nbsp; VariantClear<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>; &nbsp; <br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Create capture filter and add to graph</span><br />&nbsp; &nbsp; hr = pMoniker->BindToObject<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IID_IBaseFilter, <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pCap<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span> <br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not create capture filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; &nbsp; <br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Add capture filter to graph</span><br />&nbsp; &nbsp; hr = pGraph->AddFilter<span style=\"color: #000000;\">&#40;</span>pCap, L<span style=\"color: #ff0000;\">\"Capture Filter\"</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span> <br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not add capture filter to graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Create sample grabber filter</span><br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span>CLSID_SampleGrabber, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_IBaseFilter,<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pSampleGrabberFilter<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not create Sample Grabber filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Query the ISampleGrabber interface of the sample grabber filter</span><br />&nbsp; &nbsp; hr = pSampleGrabberFilter->QueryInterface<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DexterLib::<span style=\"color: #000000;\">IID_ISampleGrabber</span>, <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pSampleGrabber<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not get ISampleGrabber interface to sample grabber filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Enable sample buffering in the sample grabber filter</span><br />&nbsp; &nbsp; hr = pSampleGrabber->SetBufferSamples<span style=\"color: #000000;\">&#40;</span><span style=\"color: #00C800;\">TRUE</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not enable sample buffering in the sample grabber\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Set media type in sample grabber filter</span><br />&nbsp; &nbsp; AM_MEDIA_TYPE mt;<br />&nbsp; &nbsp; ZeroMemory<span style=\"color: #000000;\">&#40;</span>&mt, sizeof<span style=\"color: #000000;\">&#40;</span>AM_MEDIA_TYPE<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; mt.majortype = MEDIATYPE_Video;<br />&nbsp; &nbsp; mt.subtype = MEDIASUBTYPE_RGB24;<br />&nbsp; &nbsp; hr = pSampleGrabber->SetMediaType<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#40;</span>DexterLib::_AMMediaType *<span style=\"color: #000000;\">&#41;</span>&mt<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not set media type in sample grabber\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Add sample grabber filter to filter graph</span><br />&nbsp; &nbsp; hr = pGraph->AddFilter<span style=\"color: #000000;\">&#40;</span>pSampleGrabberFilter, L<span style=\"color: #ff0000;\">\"SampleGrab\"</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not add Sample Grabber to filter graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Create Null Renderer filter</span><br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span>CLSID_NullRenderer, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_IBaseFilter,<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pNullRenderer<span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not create Null Renderer filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Add Null Renderer filter to filter graph</span><br />&nbsp; &nbsp; hr = pGraph->AddFilter<span style=\"color: #000000;\">&#40;</span>pNullRenderer, L<span style=\"color: #ff0000;\">\"NullRender\"</span><span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not add Null Renderer to filter graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style=\"color: #B900B9;\">// Connect up the filter graph's capture stream</span><br />&nbsp; &nbsp; hr = pBuilder->RenderStream<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video,<br />&nbsp; &nbsp; &nbsp; &nbsp; pCap, &nbsp;pSampleGrabberFilter, pNullRenderer<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not render capture video stream\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; hr = pBuilder->RenderStream<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pCap, <span style=\"color: #00C800;\">NULL</span>, <span style=\"color: #00C800;\">NULL</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; <br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr != S_OK && hr != VFW_S_NOPREVIEWPIN<span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not render preview video stream\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get media control interfaces to graph builder object</span><br />&nbsp; &nbsp; hr = pGraph->QueryInterface<span style=\"color: #000000;\">&#40;</span>IID_IMediaControl,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pMediaControl<span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span> <br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not get media control interface\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Run graph</span><br />&nbsp; &nbsp; <span style=\"color: #00C800;\">while</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span><span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; hr = pMediaControl->Run<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Hopefully, the return value was S_OK or S_FALSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr == S_OK<span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">break</span>; <span style=\"color: #B900B9;\">// graph is now running</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr == S_FALSE<span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">continue</span>; <span style=\"color: #B900B9;\">// graph still preparing to run</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// If the Run function returned something else,</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// there must be a problem</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// fprintf(stderr, \"Error: %u\\n\", hr);</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not run filter graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"done\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; &nbsp; <br /><span style=\"color: #000000;\">&#125;</span><br /><br /><span style=\"color: #00D7D7;\">#pragma</span> ENDDUMP</div>[/code:fgmm2z0l]", "time": "00:09", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "Tim,\n\nPlease copy my PRG to FWH\\samples\\dshow.prg and do buildh32.bat dshow\n\nThats how I am testing it here", "time": "00:10", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "[img:2q43y6tt]https&#58;//bitbucket&#46;org/fivetech/screenshots/downloads/dshow&#46;JPG[/img:2q43y6tt]", "time": "00:15", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "Are these still Borland builds ? I still cannot get it to compile with MSVC 2015\n\nTim", "time": "00:19", "topic": "Camera Control needed for Tablet", "username": "TimStone" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "I am using MSVC 2015 Community Edition\n\ndo samples\\buildh32.bat dshow", "time": "00:20", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "going to bed <!-- s:-) --><img src=\"{SMILIES_PATH}/icon_smile.gif\" alt=\":-)\" title=\"Smile\" /><!-- s:-) -->", "time": "00:23", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "I'm getting an error at line 5, and the a has an ' over it.", "time": "00:30", "topic": "Camera Control needed for Tablet", "username": "TimStone" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "I cleaned up the space around that line, and now get the following build error following your instructions:\n\n[code=fw:14oc34cs]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><br />Lines <span style=\"color: #000000;\">4861</span>, Functions/Procedures <span style=\"color: #000000;\">1</span><br />Generating C source output <span style=\"color: #0000ff;\">to</span> <span style=\"color: #ff0000;\">'dshow.c'</span>... Done.<br />dshow.c<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">22</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C3873: <span style=\"color: #ff0000;\">'0xa0'</span>: <span style=\"color: #000000;\">this</span> character is not allowed as a first character <span style=\"color: #0000ff;\">of</span> an identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">22</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿ'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">22</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2146: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #000000;\">missing</span> <span style=\"color: #ff0000;\">';'</span> before identifier <span style=\"color: #ff0000;\">'ÿHRESULT'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">22</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿHRESULT'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">22</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2146: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #000000;\">missing</span> <span style=\"color: #ff0000;\">';'</span> before identifier <span style=\"color: #ff0000;\">'hr'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">22</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'hr'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">23</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C3873: <span style=\"color: #ff0000;\">'0xa0'</span>: <span style=\"color: #000000;\">this</span> character is not allowed as a first character <span style=\"color: #0000ff;\">of</span> an identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">23</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿ'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">23</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2146: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #000000;\">missing</span> <span style=\"color: #ff0000;\">';'</span> before identifier <span style=\"color: #ff0000;\">'ÿICreateDevEnum'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">23</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿICreateDevEnum'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">23</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'pDevEnum'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">24</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C3873: <span style=\"color: #ff0000;\">'0xa0'</span>: <span style=\"color: #000000;\">this</span> character is not allowed as a first character <span style=\"color: #0000ff;\">of</span> an identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">24</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿ'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">24</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2146: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #000000;\">missing</span> <span style=\"color: #ff0000;\">';'</span> before identifier <span style=\"color: #ff0000;\">'ÿIEnumMoniker'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">24</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿIEnumMoniker'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">24</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'pEnum'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">25</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C3873: <span style=\"color: #ff0000;\">'0xa0'</span>: <span style=\"color: #000000;\">this</span> character is not allowed as a first character <span style=\"color: #0000ff;\">of</span> an identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">25</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿ'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">25</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2146: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #000000;\">missing</span> <span style=\"color: #ff0000;\">';'</span> before identifier <span style=\"color: #ff0000;\">'ÿIMoniker'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">25</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿIMoniker'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">25</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'pMoniker'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">26</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C3873: <span style=\"color: #ff0000;\">'0xa0'</span>: <span style=\"color: #000000;\">this</span> character is not allowed as a first character <span style=\"color: #0000ff;\">of</span> an identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">26</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿ'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">26</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2146: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #000000;\">missing</span> <span style=\"color: #ff0000;\">';'</span> before identifier <span style=\"color: #ff0000;\">'ÿIPropertyBag'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">26</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿIPropertyBag'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">26</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'pPropBag'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">27</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C3873: <span style=\"color: #ff0000;\">'0xa0'</span>: <span style=\"color: #000000;\">this</span> character is not allowed as a first character <span style=\"color: #0000ff;\">of</span> an identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">27</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿ'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">27</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2146: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #000000;\">missing</span> <span style=\"color: #ff0000;\">';'</span> before identifier <span style=\"color: #ff0000;\">'ÿIGraphBuilder'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">27</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿIGraphBuilder'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">27</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'pGraph'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">28</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C3873: <span style=\"color: #ff0000;\">'0xa0'</span>: <span style=\"color: #000000;\">this</span> character is not allowed as a first character <span style=\"color: #0000ff;\">of</span> an identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">28</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿ'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">28</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2146: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #000000;\">missing</span> <span style=\"color: #ff0000;\">';'</span> before identifier <span style=\"color: #ff0000;\">'ÿICaptureGraphBuilder2'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">28</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿICaptureGraphBuilder2'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">28</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'pBuilder'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">29</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C3873: <span style=\"color: #ff0000;\">'0xa0'</span>: <span style=\"color: #000000;\">this</span> character is not allowed as a first character <span style=\"color: #0000ff;\">of</span> an identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">29</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿ'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">29</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2146: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #000000;\">missing</span> <span style=\"color: #ff0000;\">';'</span> before identifier <span style=\"color: #ff0000;\">'ÿIBaseFilter'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">29</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿIBaseFilter'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">29</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'pCap'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">30</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C3873: <span style=\"color: #ff0000;\">'0xa0'</span>: <span style=\"color: #000000;\">this</span> character is not allowed as a first character <span style=\"color: #0000ff;\">of</span> an identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">30</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿ'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">30</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2146: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #000000;\">missing</span> <span style=\"color: #ff0000;\">';'</span> before identifier <span style=\"color: #ff0000;\">'ÿIBaseFilter'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">30</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿIBaseFilter'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">30</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'pSampleGrabberFilter'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">31</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C3873: <span style=\"color: #ff0000;\">'0xa0'</span>: <span style=\"color: #000000;\">this</span> character is not allowed as a first character <span style=\"color: #0000ff;\">of</span> an identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">31</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿ'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">31</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2146: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #000000;\">missing</span> <span style=\"color: #ff0000;\">';'</span> before identifier <span style=\"color: #ff0000;\">'ÿIBaseFilter'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">31</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿIBaseFilter'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">31</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'pNullRenderer'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">32</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C3873: <span style=\"color: #ff0000;\">'0xa0'</span>: <span style=\"color: #000000;\">this</span> character is not allowed as a first character <span style=\"color: #0000ff;\">of</span> an identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">32</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿ'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">32</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2146: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #000000;\">missing</span> <span style=\"color: #ff0000;\">';'</span> before identifier <span style=\"color: #ff0000;\">'ÿIMediaControl'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">32</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿIMediaControl'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">32</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'pMediaControl'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">33</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C3873: <span style=\"color: #ff0000;\">'0xa0'</span>: <span style=\"color: #000000;\">this</span> character is not allowed as a first character <span style=\"color: #0000ff;\">of</span> an identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">33</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿ'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">33</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2146: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #000000;\">missing</span> <span style=\"color: #ff0000;\">';'</span> before identifier <span style=\"color: #ff0000;\">'ÿchar'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">33</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿchar'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">33</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'pBuffer'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">34</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C3873: <span style=\"color: #ff0000;\">'0xa0'</span>: <span style=\"color: #000000;\">this</span> character is not allowed as a first character <span style=\"color: #0000ff;\">of</span> an identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">34</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿ'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">34</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2146: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #000000;\">missing</span> <span style=\"color: #ff0000;\">';'</span> before identifier <span style=\"color: #ff0000;\">'ÿVARIANT'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">34</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿVARIANT'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">34</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2146: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #000000;\">missing</span> <span style=\"color: #ff0000;\">';'</span> before identifier <span style=\"color: #ff0000;\">'var'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">34</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'var'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">35</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C3873: <span style=\"color: #ff0000;\">'0xa0'</span>: <span style=\"color: #000000;\">this</span> character is not allowed as a first character <span style=\"color: #0000ff;\">of</span> an identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">35</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿ'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">35</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2146: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #000000;\">missing</span> <span style=\"color: #ff0000;\">';'</span> before identifier <span style=\"color: #ff0000;\">'ÿ'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">35</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2144: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #ff0000;\">'int'</span> should be preceded by <span style=\"color: #ff0000;\">';'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">36</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C3873: <span style=\"color: #ff0000;\">'0xa0'</span>: <span style=\"color: #000000;\">this</span> character is not allowed as a first character <span style=\"color: #0000ff;\">of</span> an identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">36</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿ'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">36</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2146: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #000000;\">missing</span> <span style=\"color: #ff0000;\">';'</span> before identifier <span style=\"color: #ff0000;\">'ÿ'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">36</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2144: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #ff0000;\">'int'</span> should be preceded by <span style=\"color: #ff0000;\">';'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">37</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C3873: <span style=\"color: #ff0000;\">'0xa0'</span>: <span style=\"color: #000000;\">this</span> character is not allowed as a first character <span style=\"color: #0000ff;\">of</span> an identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">37</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿ'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">37</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2146: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #000000;\">missing</span> <span style=\"color: #ff0000;\">';'</span> before identifier <span style=\"color: #ff0000;\">'ÿ'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">37</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2144: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #ff0000;\">'char'</span> should be preceded by <span style=\"color: #ff0000;\">';'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">38</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C3873: <span style=\"color: #ff0000;\">'0xa0'</span>: <span style=\"color: #000000;\">this</span> character is not allowed as a first character <span style=\"color: #0000ff;\">of</span> an identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">38</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿ'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">38</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2146: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #000000;\">missing</span> <span style=\"color: #ff0000;\">';'</span> before identifier <span style=\"color: #ff0000;\">'ÿchar'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">38</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿchar'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">38</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2146: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #000000;\">missing</span> <span style=\"color: #ff0000;\">';'</span> before identifier <span style=\"color: #ff0000;\">'char_buffer'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">38</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'char_buffer'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">39</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C3873: <span style=\"color: #ff0000;\">'0xa0'</span>: <span style=\"color: #000000;\">this</span> character is not allowed as a first character <span style=\"color: #0000ff;\">of</span> an identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">39</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2653: <span style=\"color: #ff0000;\">'ÿDexterLib'</span>: <span style=\"color: #000000;\">is</span> not a <span style=\"color: #00C800;\">class</span> or namespace <span style=\"color: #0000ff;\">name</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">39</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿ'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">39</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2146: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #000000;\">missing</span> <span style=\"color: #ff0000;\">';'</span> before identifier <span style=\"color: #ff0000;\">'ISampleGrabber'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">39</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ISampleGrabber'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">39</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'pSampleGrabber'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">41</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C3873: <span style=\"color: #ff0000;\">'0xa0'</span>: <span style=\"color: #000000;\">this</span> character is not allowed as a first character <span style=\"color: #0000ff;\">of</span> an identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">41</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿ'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">41</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2146: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #000000;\">missing</span> <span style=\"color: #ff0000;\">';'</span> before identifier <span style=\"color: #ff0000;\">'ÿstrcpy'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">41</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C3861: <span style=\"color: #ff0000;\">'ÿstrcpy'</span>: <span style=\"color: #000000;\">identifier</span> not found<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">43</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C3873: <span style=\"color: #ff0000;\">'0xa0'</span>: <span style=\"color: #000000;\">this</span> character is not allowed as a first character <span style=\"color: #0000ff;\">of</span> an identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">43</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿ'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">43</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2146: <span style=\"color: #000000;\">syntax</span> error: <span style=\"color: #000000;\">missing</span> <span style=\"color: #ff0000;\">';'</span> before identifier <span style=\"color: #ff0000;\">'ÿhr'</span><br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">43</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿhr'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">45</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C3873: <span style=\"color: #ff0000;\">'0xa0'</span>: <span style=\"color: #000000;\">this</span> character is not allowed as a first character <span style=\"color: #0000ff;\">of</span> an identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">45</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">error</span> C2065: <span style=\"color: #ff0000;\">'ÿ'</span>: <span style=\"color: #000000;\">undeclared</span> identifier<br />dshow.prg<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">45</span><span style=\"color: #000000;\">&#41;</span>: <span style=\"color: #000000;\">fatal</span> error C1003: <span style=\"color: #000000;\">error</span> <span style=\"color: #0000ff;\">count</span> exceeds <span style=\"color: #000000;\">100</span>; stopping compilation<br />LINK : <span style=\"color: #000000;\">fatal</span> error LNK1181: <span style=\"color: #000000;\">cannot</span> open input file <span style=\"color: #ff0000;\">'dshow.obj'</span><br />* Linking errors *<br />&nbsp;</div>[/code:14oc34cs]\n\nI must be missing something in my available files.\n\nTim", "time": "03:42", "topic": "Camera Control needed for Tablet", "username": "TimStone" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "Tim,\n\nPlease use this dshow.prg:\n\n[url:2k9yqo89]https&#58;//bitbucket&#46;org/fivetech/fivewin-contributions/downloads/dshow&#46;prg[/url:2k9yqo89]", "time": "16:07", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "Antonio,\n\nI am able to get this to compile and run using VS 2015, but I needed to do/change a couple things:\n\n1) Explicitly set to compile as CPP code instead of C.\n2) Changed MessageBox() calls to MessageBoxA() to get around a unicode/casting error.", "time": "18:01", "topic": "Camera Control needed for Tablet", "username": "rhlawek" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "Robb,\n\nYes, it has to be compiled in C++ mode\n\nFWH\\samples\\buildh32.bat does it automatically", "time": "18:05", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "> 2) Changed MessageBox() calls to MessageBoxA() to get around a unicode/casting error\n\nthat may be as you are using unicode at compiling time.\n\nbuildh32.bat works fine and does not use unicode", "time": "18:07", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "One other thing I forgot is I had to add \"strmiids\" to my list of libs to resolve a bunch of unresolved externals. I don't see that lib referenced in buildh32.bat so I'm not sure why I see the missing externals and you don't.\n\nI am able to get it to run both as 32 and 64 bit.", "time": "18:14", "topic": "Camera Control needed for Tablet", "username": "rhlawek" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "Robb,\n\nI mentioned here that strmiids.lib has to be linked:\n\n<!-- l --><a class=\"postlink-local\" href=\"http://forums.fivetechsupport.com/viewtopic.php?p=193422#p193422\">viewtopic.php?p=193422#p193422</a><!-- l -->\n\nmany thanks for your feedback", "time": "18:27", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "This version turns the ActiveMovie Window as a child window of our app:\n\ndshow.prg\n[code=fw:3taqji07]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><span style=\"color: #00D7D7;\">#include</span> <span style=\"color: #ff0000;\">\"FiveWin.ch\"</span><br /><br /><span style=\"color: #00C800;\">function</span> Main<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">local</span> oWnd, hWnd<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style=\"color: #0000ff;\">DEFINE</span> <span style=\"color: #0000ff;\">WINDOW</span> oWnd<br /><br />&nbsp; &nbsp;<span style=\"color: #0000ff;\">ACTIVATE</span> <span style=\"color: #0000ff;\">WINDOW</span> oWnd <span style=\"color: #0000ff;\">MAXIMIZED</span> ;<br />&nbsp; &nbsp; &nbsp; <span style=\"color: #0000ff;\">ON</span> <span style=\"color: #0000ff;\">INIT</span> <span style=\"color: #000000;\">&#40;</span> DShowCamera<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetParent<span style=\"color: #000000;\">&#40;</span> hWnd := FindWindow<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"ActiveMovie Window\"</span> <span style=\"color: #000000;\">&#41;</span>, oWnd:<span style=\"color: #000000;\">hWnd</span> <span style=\"color: #000000;\">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetWindowPos<span style=\"color: #000000;\">&#40;</span> hWnd, <span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">10</span>, <span style=\"color: #000000;\">10</span>, <span style=\"color: #000000;\">300</span>, <span style=\"color: #000000;\">300</span> <span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#41;</span><br /><br /><span style=\"color: #00C800;\">return</span> <span style=\"color: #00C800;\">nil</span><br /><br /><span style=\"color: #00D7D7;\">#pragma</span> BEGINDUMP<br /><br /><span style=\"color: #00D7D7;\">#include</span> <dshow.h><br /><span style=\"color: #00D7D7;\">#include</span> <uuids.h><br /><span style=\"color: #00D7D7;\">#include</span> <objbase.h><br /><br />#import <span style=\"color: #ff0000;\">\"qedit.dll\"</span> raw_interfaces_only named_guids<br /><br />EXTERN_C const CLSID CLSID_NullRenderer;<br />EXTERN_C const CLSID CLSID_SampleGrabber;<br /><br /><span style=\"color: #00C800;\">HB_FUNC</span><span style=\"color: #000000;\">&#40;</span> DSHOWCAMERA <span style=\"color: #000000;\">&#41;</span><br /><span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp;HRESULT hr;<br />&nbsp; &nbsp;ICreateDevEnum *pDevEnum = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IEnumMoniker *pEnum = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IMoniker *pMoniker = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IPropertyBag *pPropBag = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IGraphBuilder *pGraph = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;ICaptureGraphBuilder2 *pBuilder = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pCap = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pSampleGrabberFilter = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pNullRenderer = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IMediaControl *pMediaControl = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;char *pBuffer = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;VARIANT <span style=\"color: #0000ff;\">var</span>;<br />&nbsp; &nbsp; int n = <span style=\"color: #000000;\">0</span>;<br />&nbsp; &nbsp; int device_number = <span style=\"color: #000000;\">0</span>;<br />&nbsp; &nbsp; char device_name<span style=\"color: #000000;\">&#91;</span> <span style=\"color: #000000;\">100</span> <span style=\"color: #000000;\">&#93;</span>;<br />&nbsp; &nbsp;char char_buffer<span style=\"color: #000000;\">&#91;</span><span style=\"color: #000000;\">100</span><span style=\"color: #000000;\">&#93;</span>;<br />&nbsp; &nbsp;DexterLib::<span style=\"color: #000000;\">ISampleGrabber</span> *pSampleGrabber = <span style=\"color: #00C800;\">NULL</span>;<br /><br />&nbsp; &nbsp;strcpy<span style=\"color: #000000;\">&#40;</span> device_name, <span style=\"color: #ff0000;\">\"\"</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;hr = CoInitializeEx<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #00C800;\">NULL</span>, COINIT_MULTITHREADED <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoInitializeEx error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_FilterGraph, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_IGraphBuilder,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span> void ** <span style=\"color: #000000;\">&#41;</span> &pGraph <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoCreateInstance error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_CaptureGraphBuilder2, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_ICaptureGraphBuilder2,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span> void ** <span style=\"color: #000000;\">&#41;</span> &pBuilder <span style=\"color: #000000;\">&#41;</span>; &nbsp; &nbsp; &nbsp;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoCreateInstance 2 error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; hr = <span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">&#40;</span> ICaptureGraphBuilder * <span style=\"color: #000000;\">&#41;</span> pBuilder <span style=\"color: #000000;\">&#41;</span>->SetFiltergraph<span style=\"color: #000000;\">&#40;</span> pGraph <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not attach capture graph builder to graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; <br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_SystemDeviceEnum, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span> &pDevEnum <span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not crerate system device enumerator\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = pDevEnum->CreateClassEnumerator<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSID_VideoInputDeviceCategory, &pEnum, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"No video devices found\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; <span style=\"color: #00C800;\">while</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span><span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Access next device</span><br />&nbsp; &nbsp; &nbsp; &nbsp; hr = pEnum->Next<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span>, &pMoniker, <span style=\"color: #00C800;\">NULL</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr == S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; n++; <span style=\"color: #B900B9;\">// increment device count</span><br />&nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// If device was specified by name rather than number...</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> device_number == <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get video input device name</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hr = pMoniker->BindToStorage<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span>&pPropBag<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr == S_OK<span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get current device name</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VariantInit<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hr = pPropBag->Read<span style=\"color: #000000;\">&#40;</span>L<span style=\"color: #ff0000;\">\"FriendlyName\"</span>, &var, <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Convert to a normal C string, i.e. char*</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sprintf<span style=\"color: #000000;\">&#40;</span>char_buffer, <span style=\"color: #ff0000;\">\"%ls\"</span>, <span style=\"color: #0000ff;\">var</span>.bstrVal<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VariantClear<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pPropBag->Release<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pPropBag = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Exit loop if current device name matched devname</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// MessageBox( 0, char_buffer, \"device_name\", 0 );</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span><span style=\"color: #0000ff;\">strcmp</span><span style=\"color: #000000;\">&#40;</span>device_name, char_buffer<span style=\"color: #000000;\">&#41;</span> == <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Error getting device names\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #000000;\">&#125;</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span> <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>n >= device_number<span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span> &nbsp; <br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get video input device name</span><br />&nbsp; &nbsp; hr = pMoniker->BindToStorage<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span>&pPropBag<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; VariantInit<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; hr = pPropBag->Read<span style=\"color: #000000;\">&#40;</span>L<span style=\"color: #ff0000;\">\"FriendlyName\"</span>, &var, <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// MessageBoxW( 0, L\"Capture device\", var.bstrVal, 0 );</span><br />&nbsp; &nbsp; VariantClear<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>; &nbsp; <br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Create capture filter and add to graph</span><br />&nbsp; &nbsp; hr = pMoniker->BindToObject<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IID_IBaseFilter, <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pCap<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span> <br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not create capture filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; &nbsp; <br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Add capture filter to graph</span><br />&nbsp; &nbsp; hr = pGraph->AddFilter<span style=\"color: #000000;\">&#40;</span>pCap, L<span style=\"color: #ff0000;\">\"Capture Filter\"</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span> <br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not add capture filter to graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Create sample grabber filter</span><br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span>CLSID_SampleGrabber, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_IBaseFilter,<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pSampleGrabberFilter<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not create Sample Grabber filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Query the ISampleGrabber interface of the sample grabber filter</span><br />&nbsp; &nbsp; hr = pSampleGrabberFilter->QueryInterface<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DexterLib::<span style=\"color: #000000;\">IID_ISampleGrabber</span>, <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pSampleGrabber<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not get ISampleGrabber interface to sample grabber filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Enable sample buffering in the sample grabber filter</span><br />&nbsp; &nbsp; hr = pSampleGrabber->SetBufferSamples<span style=\"color: #000000;\">&#40;</span><span style=\"color: #00C800;\">TRUE</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not enable sample buffering in the sample grabber\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Set media type in sample grabber filter</span><br />&nbsp; &nbsp; AM_MEDIA_TYPE mt;<br />&nbsp; &nbsp; ZeroMemory<span style=\"color: #000000;\">&#40;</span>&mt, sizeof<span style=\"color: #000000;\">&#40;</span>AM_MEDIA_TYPE<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; mt.majortype = MEDIATYPE_Video;<br />&nbsp; &nbsp; mt.subtype = MEDIASUBTYPE_RGB24;<br />&nbsp; &nbsp; hr = pSampleGrabber->SetMediaType<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#40;</span>DexterLib::_AMMediaType *<span style=\"color: #000000;\">&#41;</span>&mt<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not set media type in sample grabber\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Add sample grabber filter to filter graph</span><br />&nbsp; &nbsp; hr = pGraph->AddFilter<span style=\"color: #000000;\">&#40;</span>pSampleGrabberFilter, L<span style=\"color: #ff0000;\">\"SampleGrab\"</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not add Sample Grabber to filter graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Create Null Renderer filter</span><br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span>CLSID_NullRenderer, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_IBaseFilter,<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pNullRenderer<span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not create Null Renderer filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Add Null Renderer filter to filter graph</span><br />&nbsp; &nbsp; hr = pGraph->AddFilter<span style=\"color: #000000;\">&#40;</span>pNullRenderer, L<span style=\"color: #ff0000;\">\"NullRender\"</span><span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not add Null Renderer to filter graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style=\"color: #B900B9;\">// Connect up the filter graph's capture stream</span><br />&nbsp; &nbsp; hr = pBuilder->RenderStream<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video,<br />&nbsp; &nbsp; &nbsp; &nbsp; pCap, &nbsp;pSampleGrabberFilter, pNullRenderer<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not render capture video stream\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; hr = pBuilder->RenderStream<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pCap, <span style=\"color: #00C800;\">NULL</span>, <span style=\"color: #00C800;\">NULL</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; <br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr != S_OK && hr != VFW_S_NOPREVIEWPIN<span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not render preview video stream\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get media control interfaces to graph builder object</span><br />&nbsp; &nbsp; hr = pGraph->QueryInterface<span style=\"color: #000000;\">&#40;</span>IID_IMediaControl,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pMediaControl<span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span> <br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not get media control interface\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Run graph</span><br />&nbsp; &nbsp; <span style=\"color: #00C800;\">while</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span><span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; hr = pMediaControl->Run<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Hopefully, the return value was S_OK or S_FALSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr == S_OK<span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">break</span>; <span style=\"color: #B900B9;\">// graph is now running</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr == S_FALSE<span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">continue</span>; <span style=\"color: #B900B9;\">// graph still preparing to run</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// If the Run function returned something else,</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// there must be a problem</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// fprintf(stderr, \"Error: %u\\n\", hr);</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not run filter graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span><br /><span style=\"color: #000000;\">&#125;</span><br /><br /><span style=\"color: #00D7D7;\">#pragma</span> ENDDUMP</div>[/code:3taqji07]", "time": "18:28", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "Now we turn it into a control <!-- s:-) --><img src=\"{SMILIES_PATH}/icon_smile.gif\" alt=\":-)\" title=\"Smile\" /><!-- s:-) -->\n\n[code=fw:fsj9olem]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><span style=\"color: #00D7D7;\">#include</span> <span style=\"color: #ff0000;\">\"FiveWin.ch\"</span><br /><br /><span style=\"color: #00D7D7;\">#define</span> GWL_STYLE <span style=\"color: #000000;\">-16</span><br /><br /><span style=\"color: #00C800;\">function</span> Main<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br /><br />   <span style=\"color: #00C800;\">local</span> oWnd, hWnd<br />   <br />   <span style=\"color: #0000ff;\">DEFINE</span> <span style=\"color: #0000ff;\">WINDOW</span> oWnd<br /><br />   <span style=\"color: #0000ff;\">ACTIVATE</span> <span style=\"color: #0000ff;\">WINDOW</span> oWnd <span style=\"color: #0000ff;\">MAXIMIZED</span> ;<br />      <span style=\"color: #0000ff;\">ON</span> <span style=\"color: #0000ff;\">INIT</span> <span style=\"color: #000000;\">&#40;</span> DShowCamera<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>,;<br />                SetParent<span style=\"color: #000000;\">&#40;</span> hWnd := FindWindow<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"ActiveMovie Window\"</span> <span style=\"color: #000000;\">&#41;</span>, oWnd:<span style=\"color: #000000;\">hWnd</span> <span style=\"color: #000000;\">&#41;</span>,;<br />                SetWindowLong<span style=\"color: #000000;\">&#40;</span> hWnd, GWL_STYLE, nOr<span style=\"color: #000000;\">&#40;</span> WS_CHILD, WS_VISIBLE <span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#41;</span>,;<br />                SetWindowPos<span style=\"color: #000000;\">&#40;</span> hWnd, <span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">10</span>, <span style=\"color: #000000;\">10</span>, <span style=\"color: #000000;\">300</span>, <span style=\"color: #000000;\">300</span> <span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#41;</span><br /><br /><span style=\"color: #00C800;\">return</span> <span style=\"color: #00C800;\">nil</span><br /><br /><span style=\"color: #00D7D7;\">#pragma</span> BEGINDUMP<br /><br /><span style=\"color: #00D7D7;\">#include</span> <dshow.h><br /><span style=\"color: #00D7D7;\">#include</span> <uuids.h><br /><span style=\"color: #00D7D7;\">#include</span> <objbase.h><br /><br />#import <span style=\"color: #ff0000;\">\"qedit.dll\"</span> raw_interfaces_only named_guids<br /><br />EXTERN_C const CLSID CLSID_NullRenderer;<br />EXTERN_C const CLSID CLSID_SampleGrabber;<br /><br /><span style=\"color: #00C800;\">HB_FUNC</span><span style=\"color: #000000;\">&#40;</span> DSHOWCAMERA <span style=\"color: #000000;\">&#41;</span><br /><span style=\"color: #000000;\">&#123;</span><br />   HRESULT hr;<br />   ICreateDevEnum *pDevEnum = <span style=\"color: #00C800;\">NULL</span>;<br />   IEnumMoniker *pEnum = <span style=\"color: #00C800;\">NULL</span>;<br />   IMoniker *pMoniker = <span style=\"color: #00C800;\">NULL</span>;<br />   IPropertyBag *pPropBag = <span style=\"color: #00C800;\">NULL</span>;<br />   IGraphBuilder *pGraph = <span style=\"color: #00C800;\">NULL</span>;<br />   ICaptureGraphBuilder2 *pBuilder = <span style=\"color: #00C800;\">NULL</span>;<br />   IBaseFilter *pCap = <span style=\"color: #00C800;\">NULL</span>;<br />   IBaseFilter *pSampleGrabberFilter = <span style=\"color: #00C800;\">NULL</span>;<br />   IBaseFilter *pNullRenderer = <span style=\"color: #00C800;\">NULL</span>;<br />   IMediaControl *pMediaControl = <span style=\"color: #00C800;\">NULL</span>;<br />   char *pBuffer = <span style=\"color: #00C800;\">NULL</span>;<br />   VARIANT <span style=\"color: #0000ff;\">var</span>;<br />    int n = <span style=\"color: #000000;\">0</span>;<br />    int device_number = <span style=\"color: #000000;\">0</span>;<br />    char device_name<span style=\"color: #000000;\">&#91;</span> <span style=\"color: #000000;\">100</span> <span style=\"color: #000000;\">&#93;</span>;<br />   char char_buffer<span style=\"color: #000000;\">&#91;</span><span style=\"color: #000000;\">100</span><span style=\"color: #000000;\">&#93;</span>;<br />   DexterLib::<span style=\"color: #000000;\">ISampleGrabber</span> *pSampleGrabber = <span style=\"color: #00C800;\">NULL</span>;<br /><br />   strcpy<span style=\"color: #000000;\">&#40;</span> device_name, <span style=\"color: #ff0000;\">\"\"</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />   hr = CoInitializeEx<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #00C800;\">NULL</span>, COINIT_MULTITHREADED <span style=\"color: #000000;\">&#41;</span>;<br /><br />   <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />      MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoInitializeEx error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />   hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_FilterGraph, <span style=\"color: #00C800;\">NULL</span>,<br />              CLSCTX_INPROC_SERVER, IID_IGraphBuilder,<br />              <span style=\"color: #000000;\">&#40;</span> void ** <span style=\"color: #000000;\">&#41;</span> &pGraph <span style=\"color: #000000;\">&#41;</span>;<br />           <br />   <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />      MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoCreateInstance error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />      <br />    hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_CaptureGraphBuilder2, <span style=\"color: #00C800;\">NULL</span>,<br />            CLSCTX_INPROC_SERVER, IID_ICaptureGraphBuilder2,<br />            <span style=\"color: #000000;\">&#40;</span> void ** <span style=\"color: #000000;\">&#41;</span> &pBuilder <span style=\"color: #000000;\">&#41;</span>;      <br /><br />   <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />      MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoCreateInstance 2 error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />    hr = <span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">&#40;</span> ICaptureGraphBuilder * <span style=\"color: #000000;\">&#41;</span> pBuilder <span style=\"color: #000000;\">&#41;</span>->SetFiltergraph<span style=\"color: #000000;\">&#40;</span> pGraph <span style=\"color: #000000;\">&#41;</span>;<br />   <br />    <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />        MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not attach capture graph builder to graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; <br />      <br />    hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_SystemDeviceEnum, <span style=\"color: #00C800;\">NULL</span>,<br />            CLSCTX_INPROC_SERVER, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span> &pDevEnum <span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#41;</span>;<br />         <br />    <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />        MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not crerate system device enumerator\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />      <br />    hr = pDevEnum->CreateClassEnumerator<span style=\"color: #000000;\">&#40;</span><br />                    CLSID_VideoInputDeviceCategory, &pEnum, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />               <br />    <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />        MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"No video devices found\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;      <br />      <br />    <span style=\"color: #00C800;\">while</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span><span style=\"color: #000000;\">&#41;</span><br />    <span style=\"color: #000000;\">&#123;</span><br />        <span style=\"color: #B900B9;\">// Access next device</span><br />        hr = pEnum->Next<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span>, &pMoniker, <span style=\"color: #00C800;\">NULL</span><span style=\"color: #000000;\">&#41;</span>;<br />        <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr == S_OK <span style=\"color: #000000;\">&#41;</span><br />            n++; <span style=\"color: #B900B9;\">// increment device count</span><br />      <span style=\"color: #00C800;\">else</span>   <br />         <span style=\"color: #00C800;\">break</span>;<br />        <br />        <span style=\"color: #B900B9;\">// If device was specified by name rather than number...</span><br />        <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> device_number == <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span><br />        <span style=\"color: #000000;\">&#123;</span><br />            <span style=\"color: #B900B9;\">// Get video input device name</span><br />            hr = pMoniker->BindToStorage<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span>&pPropBag<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>;<br />            <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr == S_OK<span style=\"color: #000000;\">&#41;</span><br />            <span style=\"color: #000000;\">&#123;</span><br />                <span style=\"color: #B900B9;\">// Get current device name</span><br />                VariantInit<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />                hr = pPropBag->Read<span style=\"color: #000000;\">&#40;</span>L<span style=\"color: #ff0000;\">\"FriendlyName\"</span>, &var, <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span>;<br />                <br />                <span style=\"color: #B900B9;\">// Convert to a normal C string, i.e. char*</span><br />                sprintf<span style=\"color: #000000;\">&#40;</span>char_buffer, <span style=\"color: #ff0000;\">\"%ls\"</span>, <span style=\"color: #0000ff;\">var</span>.bstrVal<span style=\"color: #000000;\">&#41;</span>;<br />                VariantClear<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />                pPropBag->Release<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>;<br />                pPropBag = <span style=\"color: #00C800;\">NULL</span>;<br />                <br />                <span style=\"color: #B900B9;\">// Exit loop if current device name matched devname</span><br />            <span style=\"color: #B900B9;\">// MessageBox( 0, char_buffer, \"device_name\", 0 );</span><br />            <br />                <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span><span style=\"color: #0000ff;\">strcmp</span><span style=\"color: #000000;\">&#40;</span>device_name, char_buffer<span style=\"color: #000000;\">&#41;</span> == <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">break</span>;<br />            <span style=\"color: #000000;\">&#125;</span><br />            <span style=\"color: #00C800;\">else</span><br />         <span style=\"color: #000000;\">&#123;</span><br />                MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Error getting device names\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />            <span style=\"color: #00C800;\">break</span>;<br />         <span style=\"color: #000000;\">&#125;</span>   <br />        <span style=\"color: #000000;\">&#125;</span><br />        <span style=\"color: #00C800;\">else</span> <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>n >= device_number<span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">break</span>;<br />    <span style=\"color: #000000;\">&#125;</span>   <br />   <br />    <span style=\"color: #B900B9;\">// Get video input device name</span><br />    hr = pMoniker->BindToStorage<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span>&pPropBag<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>;<br />    VariantInit<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />    hr = pPropBag->Read<span style=\"color: #000000;\">&#40;</span>L<span style=\"color: #ff0000;\">\"FriendlyName\"</span>, &var, <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span>;<br />    <span style=\"color: #B900B9;\">// MessageBoxW( 0, L\"Capture device\", var.bstrVal, 0 );</span><br />    VariantClear<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;   <br />   <br />    <span style=\"color: #B900B9;\">// Create capture filter and add to graph</span><br />    hr = pMoniker->BindToObject<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>,<br />                    IID_IBaseFilter, <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pCap<span style=\"color: #000000;\">&#41;</span>;<br />               <br />    <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span> <br />      MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not create capture filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;   <br /><br />    <span style=\"color: #B900B9;\">// Add capture filter to graph</span><br />    hr = pGraph->AddFilter<span style=\"color: #000000;\">&#40;</span>pCap, L<span style=\"color: #ff0000;\">\"Capture Filter\"</span><span style=\"color: #000000;\">&#41;</span>;<br />   <br />    <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span> <br />      MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not add capture filter to graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />    <span style=\"color: #B900B9;\">// Create sample grabber filter</span><br />    hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span>CLSID_SampleGrabber, <span style=\"color: #00C800;\">NULL</span>,<br />        CLSCTX_INPROC_SERVER, IID_IBaseFilter,<br />        <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pSampleGrabberFilter<span style=\"color: #000000;\">&#41;</span>;<br />      <br />    <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />        MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not create Sample Grabber filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />    <span style=\"color: #B900B9;\">// Query the ISampleGrabber interface of the sample grabber filter</span><br />    hr = pSampleGrabberFilter->QueryInterface<span style=\"color: #000000;\">&#40;</span><br />            DexterLib::<span style=\"color: #000000;\">IID_ISampleGrabber</span>, <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pSampleGrabber<span style=\"color: #000000;\">&#41;</span>;<br />         <br />    <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />        MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not get ISampleGrabber interface to sample grabber filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />    <span style=\"color: #B900B9;\">// Enable sample buffering in the sample grabber filter</span><br />    hr = pSampleGrabber->SetBufferSamples<span style=\"color: #000000;\">&#40;</span><span style=\"color: #00C800;\">TRUE</span><span style=\"color: #000000;\">&#41;</span>;<br />   <br />    <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />        MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not enable sample buffering in the sample grabber\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />    <span style=\"color: #B900B9;\">// Set media type in sample grabber filter</span><br />    AM_MEDIA_TYPE mt;<br />    ZeroMemory<span style=\"color: #000000;\">&#40;</span>&mt, sizeof<span style=\"color: #000000;\">&#40;</span>AM_MEDIA_TYPE<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>;<br />    mt.majortype = MEDIATYPE_Video;<br />    mt.subtype = MEDIASUBTYPE_RGB24;<br />    hr = pSampleGrabber->SetMediaType<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#40;</span>DexterLib::_AMMediaType *<span style=\"color: #000000;\">&#41;</span>&mt<span style=\"color: #000000;\">&#41;</span>;<br />   <br />    <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />        MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not set media type in sample grabber\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />    <span style=\"color: #B900B9;\">// Add sample grabber filter to filter graph</span><br />    hr = pGraph->AddFilter<span style=\"color: #000000;\">&#40;</span>pSampleGrabberFilter, L<span style=\"color: #ff0000;\">\"SampleGrab\"</span><span style=\"color: #000000;\">&#41;</span>;<br />   <br />    <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />        MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not add Sample Grabber to filter graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />    <span style=\"color: #B900B9;\">// Create Null Renderer filter</span><br />    hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span>CLSID_NullRenderer, <span style=\"color: #00C800;\">NULL</span>,<br />        CLSCTX_INPROC_SERVER, IID_IBaseFilter,<br />        <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pNullRenderer<span style=\"color: #000000;\">&#41;</span>;<br /><br />   <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />        MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not create Null Renderer filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />    <span style=\"color: #B900B9;\">// Add Null Renderer filter to filter graph</span><br />    hr = pGraph->AddFilter<span style=\"color: #000000;\">&#40;</span>pNullRenderer, L<span style=\"color: #ff0000;\">\"NullRender\"</span><span style=\"color: #000000;\">&#41;</span>;<br /><br />   <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />        MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not add Null Renderer to filter graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />      <br />   <span style=\"color: #B900B9;\">// Connect up the filter graph's capture stream</span><br />    hr = pBuilder->RenderStream<span style=\"color: #000000;\">&#40;</span><br />        &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video,<br />        pCap,  pSampleGrabberFilter, pNullRenderer<span style=\"color: #000000;\">&#41;</span>;<br />      <br />    <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />        MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not render capture video stream\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />    hr = pBuilder->RenderStream<span style=\"color: #000000;\">&#40;</span><br />                &PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video,<br />                pCap, <span style=\"color: #00C800;\">NULL</span>, <span style=\"color: #00C800;\">NULL</span><span style=\"color: #000000;\">&#41;</span>;<br />    <br />   <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr != S_OK && hr != VFW_S_NOPREVIEWPIN<span style=\"color: #000000;\">&#41;</span><br />            MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not render preview video stream\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />    <span style=\"color: #B900B9;\">// Get media control interfaces to graph builder object</span><br />    hr = pGraph->QueryInterface<span style=\"color: #000000;\">&#40;</span>IID_IMediaControl,<br />                    <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pMediaControl<span style=\"color: #000000;\">&#41;</span>;<br /><br />   <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span> <br />      MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not get media control interface\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />    <span style=\"color: #B900B9;\">// Run graph</span><br />    <span style=\"color: #00C800;\">while</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span><span style=\"color: #000000;\">&#41;</span><br />    <span style=\"color: #000000;\">&#123;</span><br />        hr = pMediaControl->Run<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>;<br />        <br />        <span style=\"color: #B900B9;\">// Hopefully, the return value was S_OK or S_FALSE</span><br />        <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr == S_OK<span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">break</span>; <span style=\"color: #B900B9;\">// graph is now running</span><br />        <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr == S_FALSE<span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">continue</span>; <span style=\"color: #B900B9;\">// graph still preparing to run</span><br />        <br />        <span style=\"color: #B900B9;\">// If the Run function returned something else,</span><br />        <span style=\"color: #B900B9;\">// there must be a problem</span><br />        <span style=\"color: #B900B9;\">// fprintf(stderr, \"Error: %u\\n\", hr);</span><br />        MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not run filter graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />    <span style=\"color: #000000;\">&#125;</span><br /><span style=\"color: #000000;\">&#125;</span><br /><br /><span style=\"color: #00D7D7;\">#pragma</span> ENDDUMP</div>[/code:fsj9olem]", "time": "18:36", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "OK ... so I finally got it to build and work. There are a couple of warnings but we can do that later.\n\nI see we are first accessing the webcam. Ultimately, what I need is to have it open in snapshot mode. My clients will be saving photos of parts and vehicles that they will be looking at within the program.", "time": "18:44", "topic": "Camera Control needed for Tablet", "username": "TimStone" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "Then we make it a true FWH control <!-- s;-) --><img src=\"{SMILIES_PATH}/icon_wink.gif\" alt=\";-)\" title=\"Wink\" /><!-- s;-) -->\n\nClick over the camera display!\n\n[code=fw:39pl3i0j]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><span style=\"color: #00D7D7;\">#include</span> <span style=\"color: #ff0000;\">\"FiveWin.ch\"</span><br /><br /><span style=\"color: #00D7D7;\">#define</span> GWL_STYLE <span style=\"color: #000000;\">-16</span><br /><br /><span style=\"color: #00C800;\">function</span> Main<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">local</span> oWnd, hWnd, oCamera<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style=\"color: #0000ff;\">DEFINE</span> <span style=\"color: #0000ff;\">WINDOW</span> oWnd<br /><br />&nbsp; &nbsp;oCamera = TControl<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oCamera:<span style=\"color: #000000;\">bLClicked</span> = <span style=\"color: #000000;\">&#123;</span> || <span style=\"color: #0000ff;\">MsgInfo</span><span style=\"color: #000000;\">&#40;</span> <span style=\"color: #ff0000;\">\"click\"</span> <span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#125;</span><br /><br />&nbsp; &nbsp;<span style=\"color: #0000ff;\">ACTIVATE</span> <span style=\"color: #0000ff;\">WINDOW</span> oWnd <span style=\"color: #0000ff;\">MAXIMIZED</span> ;<br />&nbsp; &nbsp; &nbsp; <span style=\"color: #0000ff;\">ON</span> <span style=\"color: #0000ff;\">INIT</span> <span style=\"color: #000000;\">&#40;</span> DShowCamera<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetParent<span style=\"color: #000000;\">&#40;</span> hWnd := FindWindow<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"ActiveMovie Window\"</span> <span style=\"color: #000000;\">&#41;</span>, oWnd:<span style=\"color: #000000;\">hWnd</span> <span style=\"color: #000000;\">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetWindowLong<span style=\"color: #000000;\">&#40;</span> hWnd, GWL_STYLE, nOr<span style=\"color: #000000;\">&#40;</span> WS_CHILD, WS_VISIBLE <span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetWindowPos<span style=\"color: #000000;\">&#40;</span> hWnd, <span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">10</span>, <span style=\"color: #000000;\">10</span>, <span style=\"color: #000000;\">300</span>, <span style=\"color: #000000;\">300</span> <span style=\"color: #000000;\">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oCamera:<span style=\"color: #000000;\">oWnd</span> := oWnd, oCamera:<span style=\"color: #000000;\">hWnd</span> := hWnd, oCamera:<span style=\"color: #000000;\">Link</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#41;</span><br /><br /><span style=\"color: #00C800;\">return</span> <span style=\"color: #00C800;\">nil</span><br /><br /><span style=\"color: #00D7D7;\">#pragma</span> BEGINDUMP<br /><br /><span style=\"color: #00D7D7;\">#include</span> <dshow.h><br /><span style=\"color: #00D7D7;\">#include</span> <uuids.h><br /><span style=\"color: #00D7D7;\">#include</span> <objbase.h><br /><br />#import <span style=\"color: #ff0000;\">\"qedit.dll\"</span> raw_interfaces_only named_guids<br /><br />EXTERN_C const CLSID CLSID_NullRenderer;<br />EXTERN_C const CLSID CLSID_SampleGrabber;<br /><br /><span style=\"color: #00C800;\">HB_FUNC</span><span style=\"color: #000000;\">&#40;</span> DSHOWCAMERA <span style=\"color: #000000;\">&#41;</span><br /><span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp;HRESULT hr;<br />&nbsp; &nbsp;ICreateDevEnum *pDevEnum = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IEnumMoniker *pEnum = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IMoniker *pMoniker = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IPropertyBag *pPropBag = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IGraphBuilder *pGraph = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;ICaptureGraphBuilder2 *pBuilder = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pCap = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pSampleGrabberFilter = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pNullRenderer = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IMediaControl *pMediaControl = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;char *pBuffer = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;VARIANT <span style=\"color: #0000ff;\">var</span>;<br />&nbsp; &nbsp; int n = <span style=\"color: #000000;\">0</span>;<br />&nbsp; &nbsp; int device_number = <span style=\"color: #000000;\">0</span>;<br />&nbsp; &nbsp; char device_name<span style=\"color: #000000;\">&#91;</span> <span style=\"color: #000000;\">100</span> <span style=\"color: #000000;\">&#93;</span>;<br />&nbsp; &nbsp;char char_buffer<span style=\"color: #000000;\">&#91;</span><span style=\"color: #000000;\">100</span><span style=\"color: #000000;\">&#93;</span>;<br />&nbsp; &nbsp;DexterLib::<span style=\"color: #000000;\">ISampleGrabber</span> *pSampleGrabber = <span style=\"color: #00C800;\">NULL</span>;<br /><br />&nbsp; &nbsp;strcpy<span style=\"color: #000000;\">&#40;</span> device_name, <span style=\"color: #ff0000;\">\"\"</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;hr = CoInitializeEx<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #00C800;\">NULL</span>, COINIT_MULTITHREADED <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoInitializeEx error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_FilterGraph, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_IGraphBuilder,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span> void ** <span style=\"color: #000000;\">&#41;</span> &pGraph <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoCreateInstance error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_CaptureGraphBuilder2, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_ICaptureGraphBuilder2,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span> void ** <span style=\"color: #000000;\">&#41;</span> &pBuilder <span style=\"color: #000000;\">&#41;</span>; &nbsp; &nbsp; &nbsp;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoCreateInstance 2 error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; hr = <span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">&#40;</span> ICaptureGraphBuilder * <span style=\"color: #000000;\">&#41;</span> pBuilder <span style=\"color: #000000;\">&#41;</span>->SetFiltergraph<span style=\"color: #000000;\">&#40;</span> pGraph <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not attach capture graph builder to graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; <br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_SystemDeviceEnum, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span> &pDevEnum <span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not crerate system device enumerator\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = pDevEnum->CreateClassEnumerator<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSID_VideoInputDeviceCategory, &pEnum, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"No video devices found\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; <span style=\"color: #00C800;\">while</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span><span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Access next device</span><br />&nbsp; &nbsp; &nbsp; &nbsp; hr = pEnum->Next<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span>, &pMoniker, <span style=\"color: #00C800;\">NULL</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr == S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; n++; <span style=\"color: #B900B9;\">// increment device count</span><br />&nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// If device was specified by name rather than number...</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> device_number == <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get video input device name</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hr = pMoniker->BindToStorage<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span>&pPropBag<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr == S_OK<span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get current device name</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VariantInit<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hr = pPropBag->Read<span style=\"color: #000000;\">&#40;</span>L<span style=\"color: #ff0000;\">\"FriendlyName\"</span>, &var, <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Convert to a normal C string, i.e. char*</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sprintf<span style=\"color: #000000;\">&#40;</span>char_buffer, <span style=\"color: #ff0000;\">\"%ls\"</span>, <span style=\"color: #0000ff;\">var</span>.bstrVal<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VariantClear<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pPropBag->Release<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pPropBag = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Exit loop if current device name matched devname</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// MessageBox( 0, char_buffer, \"device_name\", 0 );</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span><span style=\"color: #0000ff;\">strcmp</span><span style=\"color: #000000;\">&#40;</span>device_name, char_buffer<span style=\"color: #000000;\">&#41;</span> == <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Error getting device names\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #000000;\">&#125;</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span> <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>n >= device_number<span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span> &nbsp; <br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get video input device name</span><br />&nbsp; &nbsp; hr = pMoniker->BindToStorage<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span>&pPropBag<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; VariantInit<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; hr = pPropBag->Read<span style=\"color: #000000;\">&#40;</span>L<span style=\"color: #ff0000;\">\"FriendlyName\"</span>, &var, <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// MessageBoxW( 0, L\"Capture device\", var.bstrVal, 0 );</span><br />&nbsp; &nbsp; VariantClear<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>; &nbsp; <br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Create capture filter and add to graph</span><br />&nbsp; &nbsp; hr = pMoniker->BindToObject<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IID_IBaseFilter, <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pCap<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span> <br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not create capture filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; &nbsp; <br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Add capture filter to graph</span><br />&nbsp; &nbsp; hr = pGraph->AddFilter<span style=\"color: #000000;\">&#40;</span>pCap, L<span style=\"color: #ff0000;\">\"Capture Filter\"</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span> <br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not add capture filter to graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Create sample grabber filter</span><br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span>CLSID_SampleGrabber, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_IBaseFilter,<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pSampleGrabberFilter<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not create Sample Grabber filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Query the ISampleGrabber interface of the sample grabber filter</span><br />&nbsp; &nbsp; hr = pSampleGrabberFilter->QueryInterface<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DexterLib::<span style=\"color: #000000;\">IID_ISampleGrabber</span>, <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pSampleGrabber<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not get ISampleGrabber interface to sample grabber filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Enable sample buffering in the sample grabber filter</span><br />&nbsp; &nbsp; hr = pSampleGrabber->SetBufferSamples<span style=\"color: #000000;\">&#40;</span><span style=\"color: #00C800;\">TRUE</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not enable sample buffering in the sample grabber\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Set media type in sample grabber filter</span><br />&nbsp; &nbsp; AM_MEDIA_TYPE mt;<br />&nbsp; &nbsp; ZeroMemory<span style=\"color: #000000;\">&#40;</span>&mt, sizeof<span style=\"color: #000000;\">&#40;</span>AM_MEDIA_TYPE<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; mt.majortype = MEDIATYPE_Video;<br />&nbsp; &nbsp; mt.subtype = MEDIASUBTYPE_RGB24;<br />&nbsp; &nbsp; hr = pSampleGrabber->SetMediaType<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#40;</span>DexterLib::_AMMediaType *<span style=\"color: #000000;\">&#41;</span>&mt<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not set media type in sample grabber\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Add sample grabber filter to filter graph</span><br />&nbsp; &nbsp; hr = pGraph->AddFilter<span style=\"color: #000000;\">&#40;</span>pSampleGrabberFilter, L<span style=\"color: #ff0000;\">\"SampleGrab\"</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not add Sample Grabber to filter graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Create Null Renderer filter</span><br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span>CLSID_NullRenderer, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_IBaseFilter,<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pNullRenderer<span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not create Null Renderer filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Add Null Renderer filter to filter graph</span><br />&nbsp; &nbsp; hr = pGraph->AddFilter<span style=\"color: #000000;\">&#40;</span>pNullRenderer, L<span style=\"color: #ff0000;\">\"NullRender\"</span><span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not add Null Renderer to filter graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style=\"color: #B900B9;\">// Connect up the filter graph's capture stream</span><br />&nbsp; &nbsp; hr = pBuilder->RenderStream<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video,<br />&nbsp; &nbsp; &nbsp; &nbsp; pCap, &nbsp;pSampleGrabberFilter, pNullRenderer<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not render capture video stream\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; hr = pBuilder->RenderStream<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pCap, <span style=\"color: #00C800;\">NULL</span>, <span style=\"color: #00C800;\">NULL</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; <br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr != S_OK && hr != VFW_S_NOPREVIEWPIN<span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not render preview video stream\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get media control interfaces to graph builder object</span><br />&nbsp; &nbsp; hr = pGraph->QueryInterface<span style=\"color: #000000;\">&#40;</span>IID_IMediaControl,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pMediaControl<span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span> <br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not get media control interface\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Run graph</span><br />&nbsp; &nbsp; <span style=\"color: #00C800;\">while</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span><span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; hr = pMediaControl->Run<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Hopefully, the return value was S_OK or S_FALSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr == S_OK<span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">break</span>; <span style=\"color: #B900B9;\">// graph is now running</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr == S_FALSE<span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">continue</span>; <span style=\"color: #B900B9;\">// graph still preparing to run</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// If the Run function returned something else,</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// there must be a problem</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// fprintf(stderr, \"Error: %u\\n\", hr);</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not run filter graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span><br /><span style=\"color: #000000;\">&#125;</span><br /><br /><span style=\"color: #00D7D7;\">#pragma</span> ENDDUMP</div>[/code:39pl3i0j]", "time": "18:48", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "Antonio, on a device with 2 or more cameras do you know how to select which camera to use?", "time": "18:39", "topic": "Camera Control needed for Tablet", "username": "rhlawek" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "Never mind on camera selection, it is a simple as changing the device number. So my next question is how to enumerate all available cameras.", "time": "18:57", "topic": "Camera Control needed for Tablet", "username": "rhlawek" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "Now you can click on it to stop it and record again, alternatively:\n\ndshow.prg\n[code=fw:1x8i1w2e]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><span style=\"color: #00D7D7;\">#include</span> <span style=\"color: #ff0000;\">\"FiveWin.ch\"</span><br /><br /><span style=\"color: #00D7D7;\">#define</span> GWL_STYLE <span style=\"color: #000000;\">-16</span><br /><br /><span style=\"color: #00C800;\">function</span> Main<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">local</span> oWnd, hWnd, oCamera, pMediaControl<br />&nbsp; &nbsp;<span style=\"color: #00C800;\">local</span> lStop := .F.<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style=\"color: #0000ff;\">DEFINE</span> <span style=\"color: #0000ff;\">WINDOW</span> oWnd<br /><br />&nbsp; &nbsp;oCamera = TControl<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oCamera:<span style=\"color: #000000;\">bLClicked</span> = <span style=\"color: #000000;\">&#123;</span> || <span style=\"color: #00C800;\">If</span><span style=\"color: #000000;\">&#40;</span> ! lStop,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DShowStop<span style=\"color: #000000;\">&#40;</span> pMediaControl <span style=\"color: #000000;\">&#41;</span>, DShowPlay<span style=\"color: #000000;\">&#40;</span> pMediaControl <span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lStop := ! lStop <span style=\"color: #000000;\">&#125;</span><br /><br />&nbsp; &nbsp;<span style=\"color: #0000ff;\">ACTIVATE</span> <span style=\"color: #0000ff;\">WINDOW</span> oWnd <span style=\"color: #0000ff;\">MAXIMIZED</span> ;<br />&nbsp; &nbsp; &nbsp; <span style=\"color: #0000ff;\">ON</span> <span style=\"color: #0000ff;\">INIT</span> <span style=\"color: #000000;\">&#40;</span> pMediaControl := DShowCamera<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetParent<span style=\"color: #000000;\">&#40;</span> hWnd := FindWindow<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"ActiveMovie Window\"</span> <span style=\"color: #000000;\">&#41;</span>, oWnd:<span style=\"color: #000000;\">hWnd</span> <span style=\"color: #000000;\">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetWindowLong<span style=\"color: #000000;\">&#40;</span> hWnd, GWL_STYLE, nOr<span style=\"color: #000000;\">&#40;</span> WS_CHILD, WS_VISIBLE <span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetWindowPos<span style=\"color: #000000;\">&#40;</span> hWnd, <span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">10</span>, <span style=\"color: #000000;\">10</span>, <span style=\"color: #000000;\">300</span>, <span style=\"color: #000000;\">300</span> <span style=\"color: #000000;\">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oCamera:<span style=\"color: #000000;\">oWnd</span> := oWnd, oCamera:<span style=\"color: #000000;\">hWnd</span> := hWnd, oCamera:<span style=\"color: #000000;\">Link</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#41;</span><br /><br /><span style=\"color: #00C800;\">return</span> <span style=\"color: #00C800;\">nil</span><br /><br /><span style=\"color: #00D7D7;\">#pragma</span> BEGINDUMP<br /><br /><span style=\"color: #00D7D7;\">#include</span> <hbapi.h><br /><span style=\"color: #00D7D7;\">#include</span> <dshow.h><br /><span style=\"color: #00D7D7;\">#include</span> <uuids.h><br /><span style=\"color: #00D7D7;\">#include</span> <objbase.h><br /><br />#import <span style=\"color: #ff0000;\">\"qedit.dll\"</span> raw_interfaces_only named_guids<br /><br />EXTERN_C const CLSID CLSID_NullRenderer;<br />EXTERN_C const CLSID CLSID_SampleGrabber;<br /><br /><span style=\"color: #00C800;\">HB_FUNC</span><span style=\"color: #000000;\">&#40;</span> DSHOWPLAY <span style=\"color: #000000;\">&#41;</span><br /><span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp;IMediaControl * pMediaControl = <span style=\"color: #000000;\">&#40;</span> IMediaControl * <span style=\"color: #000000;\">&#41;</span> hb_parnll<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">1</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;pMediaControl->Run<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>;<br /><span style=\"color: #000000;\">&#125;</span> &nbsp; <br /><br /><span style=\"color: #00C800;\">HB_FUNC</span><span style=\"color: #000000;\">&#40;</span> DSHOWSTOP <span style=\"color: #000000;\">&#41;</span><br /><span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp;IMediaControl * pMediaControl = <span style=\"color: #000000;\">&#40;</span> IMediaControl * <span style=\"color: #000000;\">&#41;</span> hb_parnll<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">1</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;pMediaControl->Stop<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>;<br /><span style=\"color: #000000;\">&#125;</span> &nbsp; <br /><br /><span style=\"color: #00C800;\">HB_FUNC</span><span style=\"color: #000000;\">&#40;</span> DSHOWCAMERA <span style=\"color: #000000;\">&#41;</span><br /><span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp;HRESULT hr;<br />&nbsp; &nbsp;ICreateDevEnum *pDevEnum = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IEnumMoniker *pEnum = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IMoniker *pMoniker = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IPropertyBag *pPropBag = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IGraphBuilder *pGraph = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;ICaptureGraphBuilder2 *pBuilder = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pCap = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pSampleGrabberFilter = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pNullRenderer = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IMediaControl *pMediaControl = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;char *pBuffer = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;VARIANT <span style=\"color: #0000ff;\">var</span>;<br />&nbsp; &nbsp; int n = <span style=\"color: #000000;\">0</span>;<br />&nbsp; &nbsp; int device_number = <span style=\"color: #000000;\">0</span>;<br />&nbsp; &nbsp; char device_name<span style=\"color: #000000;\">&#91;</span> <span style=\"color: #000000;\">100</span> <span style=\"color: #000000;\">&#93;</span>;<br />&nbsp; &nbsp;char char_buffer<span style=\"color: #000000;\">&#91;</span><span style=\"color: #000000;\">100</span><span style=\"color: #000000;\">&#93;</span>;<br />&nbsp; &nbsp;DexterLib::<span style=\"color: #000000;\">ISampleGrabber</span> *pSampleGrabber = <span style=\"color: #00C800;\">NULL</span>;<br /><br />&nbsp; &nbsp;strcpy<span style=\"color: #000000;\">&#40;</span> device_name, <span style=\"color: #ff0000;\">\"\"</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;hr = CoInitializeEx<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #00C800;\">NULL</span>, COINIT_MULTITHREADED <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoInitializeEx error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_FilterGraph, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_IGraphBuilder,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span> void ** <span style=\"color: #000000;\">&#41;</span> &pGraph <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoCreateInstance error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_CaptureGraphBuilder2, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_ICaptureGraphBuilder2,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span> void ** <span style=\"color: #000000;\">&#41;</span> &pBuilder <span style=\"color: #000000;\">&#41;</span>; &nbsp; &nbsp; &nbsp;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoCreateInstance 2 error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; hr = <span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">&#40;</span> ICaptureGraphBuilder * <span style=\"color: #000000;\">&#41;</span> pBuilder <span style=\"color: #000000;\">&#41;</span>->SetFiltergraph<span style=\"color: #000000;\">&#40;</span> pGraph <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not attach capture graph builder to graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; <br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_SystemDeviceEnum, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span> &pDevEnum <span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not crerate system device enumerator\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = pDevEnum->CreateClassEnumerator<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSID_VideoInputDeviceCategory, &pEnum, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"No video devices found\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; <span style=\"color: #00C800;\">while</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span><span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Access next device</span><br />&nbsp; &nbsp; &nbsp; &nbsp; hr = pEnum->Next<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span>, &pMoniker, <span style=\"color: #00C800;\">NULL</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr == S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; n++; <span style=\"color: #B900B9;\">// increment device count</span><br />&nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// If device was specified by name rather than number...</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> device_number == <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get video input device name</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hr = pMoniker->BindToStorage<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span>&pPropBag<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr == S_OK<span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get current device name</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VariantInit<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hr = pPropBag->Read<span style=\"color: #000000;\">&#40;</span>L<span style=\"color: #ff0000;\">\"FriendlyName\"</span>, &var, <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Convert to a normal C string, i.e. char*</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sprintf<span style=\"color: #000000;\">&#40;</span>char_buffer, <span style=\"color: #ff0000;\">\"%ls\"</span>, <span style=\"color: #0000ff;\">var</span>.bstrVal<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VariantClear<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pPropBag->Release<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pPropBag = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Exit loop if current device name matched devname</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// MessageBox( 0, char_buffer, \"device_name\", 0 );</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span><span style=\"color: #0000ff;\">strcmp</span><span style=\"color: #000000;\">&#40;</span>device_name, char_buffer<span style=\"color: #000000;\">&#41;</span> == <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Error getting device names\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #000000;\">&#125;</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span> <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>n >= device_number<span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span> &nbsp; <br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get video input device name</span><br />&nbsp; &nbsp; hr = pMoniker->BindToStorage<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span>&pPropBag<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; VariantInit<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; hr = pPropBag->Read<span style=\"color: #000000;\">&#40;</span>L<span style=\"color: #ff0000;\">\"FriendlyName\"</span>, &var, <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// MessageBoxW( 0, L\"Capture device\", var.bstrVal, 0 );</span><br />&nbsp; &nbsp; VariantClear<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>; &nbsp; <br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Create capture filter and add to graph</span><br />&nbsp; &nbsp; hr = pMoniker->BindToObject<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IID_IBaseFilter, <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pCap<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span> <br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not create capture filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; &nbsp; <br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Add capture filter to graph</span><br />&nbsp; &nbsp; hr = pGraph->AddFilter<span style=\"color: #000000;\">&#40;</span>pCap, L<span style=\"color: #ff0000;\">\"Capture Filter\"</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span> <br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not add capture filter to graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Create sample grabber filter</span><br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span>CLSID_SampleGrabber, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_IBaseFilter,<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pSampleGrabberFilter<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not create Sample Grabber filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Query the ISampleGrabber interface of the sample grabber filter</span><br />&nbsp; &nbsp; hr = pSampleGrabberFilter->QueryInterface<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DexterLib::<span style=\"color: #000000;\">IID_ISampleGrabber</span>, <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pSampleGrabber<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not get ISampleGrabber interface to sample grabber filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Enable sample buffering in the sample grabber filter</span><br />&nbsp; &nbsp; hr = pSampleGrabber->SetBufferSamples<span style=\"color: #000000;\">&#40;</span><span style=\"color: #00C800;\">TRUE</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not enable sample buffering in the sample grabber\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Set media type in sample grabber filter</span><br />&nbsp; &nbsp; AM_MEDIA_TYPE mt;<br />&nbsp; &nbsp; ZeroMemory<span style=\"color: #000000;\">&#40;</span>&mt, sizeof<span style=\"color: #000000;\">&#40;</span>AM_MEDIA_TYPE<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; mt.majortype = MEDIATYPE_Video;<br />&nbsp; &nbsp; mt.subtype = MEDIASUBTYPE_RGB24;<br />&nbsp; &nbsp; hr = pSampleGrabber->SetMediaType<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#40;</span>DexterLib::_AMMediaType *<span style=\"color: #000000;\">&#41;</span>&mt<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not set media type in sample grabber\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Add sample grabber filter to filter graph</span><br />&nbsp; &nbsp; hr = pGraph->AddFilter<span style=\"color: #000000;\">&#40;</span>pSampleGrabberFilter, L<span style=\"color: #ff0000;\">\"SampleGrab\"</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not add Sample Grabber to filter graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Create Null Renderer filter</span><br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span>CLSID_NullRenderer, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_IBaseFilter,<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pNullRenderer<span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not create Null Renderer filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Add Null Renderer filter to filter graph</span><br />&nbsp; &nbsp; hr = pGraph->AddFilter<span style=\"color: #000000;\">&#40;</span>pNullRenderer, L<span style=\"color: #ff0000;\">\"NullRender\"</span><span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not add Null Renderer to filter graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style=\"color: #B900B9;\">// Connect up the filter graph's capture stream</span><br />&nbsp; &nbsp; hr = pBuilder->RenderStream<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video,<br />&nbsp; &nbsp; &nbsp; &nbsp; pCap, &nbsp;pSampleGrabberFilter, pNullRenderer<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not render capture video stream\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; hr = pBuilder->RenderStream<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pCap, <span style=\"color: #00C800;\">NULL</span>, <span style=\"color: #00C800;\">NULL</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; <br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr != S_OK && hr != VFW_S_NOPREVIEWPIN<span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not render preview video stream\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get media control interfaces to graph builder object</span><br />&nbsp; &nbsp; hr = pGraph->QueryInterface<span style=\"color: #000000;\">&#40;</span>IID_IMediaControl,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pMediaControl<span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span> <br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not get media control interface\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Run graph</span><br />&nbsp; &nbsp; <span style=\"color: #00C800;\">while</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span><span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; hr = pMediaControl->Run<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Hopefully, the return value was S_OK or S_FALSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr == S_OK<span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">break</span>; <span style=\"color: #B900B9;\">// graph is now running</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr == S_FALSE<span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">continue</span>; <span style=\"color: #B900B9;\">// graph still preparing to run</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// If the Run function returned something else,</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// there must be a problem</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// fprintf(stderr, \"Error: %u\\n\", hr);</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not run filter graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;hb_retnll<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">&#40;</span> HB_LONGLONG <span style=\"color: #000000;\">&#41;</span> pMediaControl <span style=\"color: #000000;\">&#41;</span>;<br /><span style=\"color: #000000;\">&#125;</span><br /><br /><span style=\"color: #00D7D7;\">#pragma</span> ENDDUMP</div>[/code:1x8i1w2e]", "time": "19:00", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "Once again too many errors to compile this latest version. It seems a \"select all\" and copy of the code from the forum is adding some foreign characters. The downloaded .prg worked fine.\n\nTim", "time": "19:01", "topic": "Camera Control needed for Tablet", "username": "TimStone" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "Robb,\n\nThis code seem to do what you want:\n\n[code=fw:13ls9nkm]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\">&nbsp; &nbsp; <span style=\"color: #B900B9;\">// If the user has included the \"/list\" command line</span><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// argument, just list available devices, then exit.</span><br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>list_devices != <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; fprintf<span style=\"color: #000000;\">&#40;</span>stderr, <span style=\"color: #ff0000;\">\"Available capture devices:<span style=\"color: #000000;\">\\n</span>\"</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; n = <span style=\"color: #000000;\">0</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">while</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span><span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Find next device</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hr = pEnum->Next<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span>, &pMoniker, <span style=\"color: #00C800;\">NULL</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr == S_OK<span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Increment device counter</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; n++;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get device name</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hr = pMoniker->BindToStorage<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span>&pPropBag<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VARIANT <span style=\"color: #0000ff;\">var</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VariantInit<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hr = pPropBag->Read<span style=\"color: #000000;\">&#40;</span>L<span style=\"color: #ff0000;\">\"FriendlyName\"</span>, &var, <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fprintf<span style=\"color: #000000;\">&#40;</span>stderr, <span style=\"color: #ff0000;\">\" &nbsp;%d. %ls<span style=\"color: #000000;\">\\n</span>\"</span>, n, <span style=\"color: #0000ff;\">var</span>.bstrVal<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VariantClear<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Finished listing device, so exit program</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>n == <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span> exit_message<span style=\"color: #000000;\">&#40;</span><span style=\"color: #ff0000;\">\"No devices found\"</span>, <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span> exit_message<span style=\"color: #000000;\">&#40;</span><span style=\"color: #ff0000;\">\"\"</span>, <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span><br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span></div>[/code:13ls9nkm]", "time": "19:03", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "Tim,\n\nPlease download dshow.prg again:\n\n[url:qs5pty17]https&#58;//bitbucket&#46;org/fivetech/fivewin-contributions/downloads/dshow&#46;prg[/url:qs5pty17]", "time": "19:05", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "This version allows to take as many photos as wanted <!-- s;-) --><img src=\"{SMILIES_PATH}/icon_wink.gif\" alt=\";-)\" title=\"Wink\" /><!-- s;-) -->\n\ndshow.prg\n[code=fw:2j9zuf43]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><span style=\"color: #00D7D7;\">#include</span> <span style=\"color: #ff0000;\">\"FiveWin.ch\"</span><br /><br /><span style=\"color: #00D7D7;\">#define</span> GWL_STYLE <span style=\"color: #000000;\">-16</span><br /><br /><span style=\"color: #00C800;\">function</span> Main<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">local</span> oWnd, hWnd, oCamera, pMediaControl<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style=\"color: #0000ff;\">DEFINE</span> <span style=\"color: #0000ff;\">WINDOW</span> oWnd<br /><br />&nbsp; &nbsp;oCamera = TControl<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oCamera:<span style=\"color: #000000;\">bLClicked</span> = <span style=\"color: #000000;\">&#123;</span> || DShowStop<span style=\"color: #000000;\">&#40;</span> pMediaControl <span style=\"color: #000000;\">&#41;</span>, TakePhoto<span style=\"color: #000000;\">&#40;</span> oCamera <span style=\"color: #000000;\">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DShowPlay<span style=\"color: #000000;\">&#40;</span> pMediaControl <span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#125;</span><br /><br />&nbsp; &nbsp;<span style=\"color: #0000ff;\">ACTIVATE</span> <span style=\"color: #0000ff;\">WINDOW</span> oWnd <span style=\"color: #0000ff;\">MAXIMIZED</span> ;<br />&nbsp; &nbsp; &nbsp; <span style=\"color: #0000ff;\">ON</span> <span style=\"color: #0000ff;\">INIT</span> <span style=\"color: #000000;\">&#40;</span> pMediaControl := DShowCamera<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetParent<span style=\"color: #000000;\">&#40;</span> hWnd := FindWindow<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"ActiveMovie Window\"</span> <span style=\"color: #000000;\">&#41;</span>, oWnd:<span style=\"color: #000000;\">hWnd</span> <span style=\"color: #000000;\">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetWindowLong<span style=\"color: #000000;\">&#40;</span> hWnd, GWL_STYLE, nOr<span style=\"color: #000000;\">&#40;</span> WS_CHILD, WS_VISIBLE <span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetWindowPos<span style=\"color: #000000;\">&#40;</span> hWnd, <span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">15</span>, <span style=\"color: #000000;\">15</span>, <span style=\"color: #000000;\">300</span>, <span style=\"color: #000000;\">300</span> <span style=\"color: #000000;\">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oCamera:<span style=\"color: #000000;\">oWnd</span> := oWnd, oCamera:<span style=\"color: #000000;\">hWnd</span> := hWnd, oCamera:<span style=\"color: #000000;\">Link</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#41;</span><br /><br /><span style=\"color: #00C800;\">return</span> <span style=\"color: #00C800;\">nil</span><br /><br /><span style=\"color: #00C800;\">function</span> TakePhoto<span style=\"color: #000000;\">&#40;</span> oCamera <span style=\"color: #000000;\">&#41;</span><br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">static</span> oBmp<br /><br />&nbsp; &nbsp;oCamera:<span style=\"color: #000000;\">SaveToBmp</span><span style=\"color: #000000;\">&#40;</span> <span style=\"color: #ff0000;\">\"photo.bmp\"</span> <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span> oBmp == <span style=\"color: #00C800;\">nil</span><br />&nbsp; &nbsp; &nbsp; @ <span style=\"color: #000000;\">1</span>, <span style=\"color: #000000;\">60</span> BITMAP oBmp <span style=\"color: #0000ff;\">OF</span> oCamera:<span style=\"color: #000000;\">oWnd</span> FILENAME <span style=\"color: #ff0000;\">\"photo.bmp\"</span><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">else</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; oBmp:<span style=\"color: #000000;\">LoadImage</span><span style=\"color: #000000;\">&#40;</span> , <span style=\"color: #ff0000;\">\"photo.bmp\"</span> <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; oBmp:<span style=\"color: #0000ff;\">Refresh</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">endif</span> &nbsp; <br /><br /><span style=\"color: #00C800;\">return</span> <span style=\"color: #00C800;\">nil</span> &nbsp; <br /><br /><span style=\"color: #00D7D7;\">#pragma</span> BEGINDUMP<br /><br /><span style=\"color: #00D7D7;\">#include</span> <hbapi.h><br /><span style=\"color: #00D7D7;\">#include</span> <dshow.h><br /><span style=\"color: #00D7D7;\">#include</span> <uuids.h><br /><span style=\"color: #00D7D7;\">#include</span> <objbase.h><br /><br />#import <span style=\"color: #ff0000;\">\"qedit.dll\"</span> raw_interfaces_only named_guids<br /><br />EXTERN_C const CLSID CLSID_NullRenderer;<br />EXTERN_C const CLSID CLSID_SampleGrabber;<br /><br /><span style=\"color: #00C800;\">HB_FUNC</span><span style=\"color: #000000;\">&#40;</span> DSHOWPLAY <span style=\"color: #000000;\">&#41;</span><br /><span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp;IMediaControl * pMediaControl = <span style=\"color: #000000;\">&#40;</span> IMediaControl * <span style=\"color: #000000;\">&#41;</span> hb_parnll<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">1</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;pMediaControl->Run<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>;<br /><span style=\"color: #000000;\">&#125;</span> &nbsp; <br /><br /><span style=\"color: #00C800;\">HB_FUNC</span><span style=\"color: #000000;\">&#40;</span> DSHOWSTOP <span style=\"color: #000000;\">&#41;</span><br /><span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp;IMediaControl * pMediaControl = <span style=\"color: #000000;\">&#40;</span> IMediaControl * <span style=\"color: #000000;\">&#41;</span> hb_parnll<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">1</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;pMediaControl->Stop<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>;<br /><span style=\"color: #000000;\">&#125;</span> &nbsp; <br /><br /><span style=\"color: #00C800;\">HB_FUNC</span><span style=\"color: #000000;\">&#40;</span> DSHOWCAMERA <span style=\"color: #000000;\">&#41;</span><br /><span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp;HRESULT hr;<br />&nbsp; &nbsp;ICreateDevEnum *pDevEnum = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IEnumMoniker *pEnum = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IMoniker *pMoniker = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IPropertyBag *pPropBag = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IGraphBuilder *pGraph = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;ICaptureGraphBuilder2 *pBuilder = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pCap = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pSampleGrabberFilter = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pNullRenderer = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IMediaControl *pMediaControl = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;char *pBuffer = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;VARIANT <span style=\"color: #0000ff;\">var</span>;<br />&nbsp; &nbsp; int n = <span style=\"color: #000000;\">0</span>;<br />&nbsp; &nbsp; int device_number = <span style=\"color: #000000;\">0</span>;<br />&nbsp; &nbsp; char device_name<span style=\"color: #000000;\">&#91;</span> <span style=\"color: #000000;\">100</span> <span style=\"color: #000000;\">&#93;</span>;<br />&nbsp; &nbsp;char char_buffer<span style=\"color: #000000;\">&#91;</span><span style=\"color: #000000;\">100</span><span style=\"color: #000000;\">&#93;</span>;<br />&nbsp; &nbsp;DexterLib::<span style=\"color: #000000;\">ISampleGrabber</span> *pSampleGrabber = <span style=\"color: #00C800;\">NULL</span>;<br /><br />&nbsp; &nbsp;strcpy<span style=\"color: #000000;\">&#40;</span> device_name, <span style=\"color: #ff0000;\">\"\"</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;hr = CoInitializeEx<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #00C800;\">NULL</span>, COINIT_MULTITHREADED <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoInitializeEx error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_FilterGraph, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_IGraphBuilder,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span> void ** <span style=\"color: #000000;\">&#41;</span> &pGraph <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoCreateInstance error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_CaptureGraphBuilder2, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_ICaptureGraphBuilder2,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span> void ** <span style=\"color: #000000;\">&#41;</span> &pBuilder <span style=\"color: #000000;\">&#41;</span>; &nbsp; &nbsp; &nbsp;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoCreateInstance 2 error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; hr = <span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">&#40;</span> ICaptureGraphBuilder * <span style=\"color: #000000;\">&#41;</span> pBuilder <span style=\"color: #000000;\">&#41;</span>->SetFiltergraph<span style=\"color: #000000;\">&#40;</span> pGraph <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not attach capture graph builder to graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; <br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_SystemDeviceEnum, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span> &pDevEnum <span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not crerate system device enumerator\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = pDevEnum->CreateClassEnumerator<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSID_VideoInputDeviceCategory, &pEnum, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"No video devices found\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; <span style=\"color: #00C800;\">while</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span><span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Access next device</span><br />&nbsp; &nbsp; &nbsp; &nbsp; hr = pEnum->Next<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span>, &pMoniker, <span style=\"color: #00C800;\">NULL</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr == S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; n++; <span style=\"color: #B900B9;\">// increment device count</span><br />&nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// If device was specified by name rather than number...</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> device_number == <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get video input device name</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hr = pMoniker->BindToStorage<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span>&pPropBag<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr == S_OK<span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get current device name</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VariantInit<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hr = pPropBag->Read<span style=\"color: #000000;\">&#40;</span>L<span style=\"color: #ff0000;\">\"FriendlyName\"</span>, &var, <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Convert to a normal C string, i.e. char*</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sprintf<span style=\"color: #000000;\">&#40;</span>char_buffer, <span style=\"color: #ff0000;\">\"%ls\"</span>, <span style=\"color: #0000ff;\">var</span>.bstrVal<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VariantClear<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pPropBag->Release<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pPropBag = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Exit loop if current device name matched devname</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// MessageBox( 0, char_buffer, \"device_name\", 0 );</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span><span style=\"color: #0000ff;\">strcmp</span><span style=\"color: #000000;\">&#40;</span>device_name, char_buffer<span style=\"color: #000000;\">&#41;</span> == <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Error getting device names\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #000000;\">&#125;</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span> <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>n >= device_number<span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span> &nbsp; <br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get video input device name</span><br />&nbsp; &nbsp; hr = pMoniker->BindToStorage<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span>&pPropBag<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; VariantInit<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; hr = pPropBag->Read<span style=\"color: #000000;\">&#40;</span>L<span style=\"color: #ff0000;\">\"FriendlyName\"</span>, &var, <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// MessageBoxW( 0, L\"Capture device\", var.bstrVal, 0 );</span><br />&nbsp; &nbsp; VariantClear<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>; &nbsp; <br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Create capture filter and add to graph</span><br />&nbsp; &nbsp; hr = pMoniker->BindToObject<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IID_IBaseFilter, <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pCap<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span> <br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not create capture filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; &nbsp; <br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Add capture filter to graph</span><br />&nbsp; &nbsp; hr = pGraph->AddFilter<span style=\"color: #000000;\">&#40;</span>pCap, L<span style=\"color: #ff0000;\">\"Capture Filter\"</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span> <br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not add capture filter to graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Create sample grabber filter</span><br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span>CLSID_SampleGrabber, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_IBaseFilter,<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pSampleGrabberFilter<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not create Sample Grabber filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Query the ISampleGrabber interface of the sample grabber filter</span><br />&nbsp; &nbsp; hr = pSampleGrabberFilter->QueryInterface<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DexterLib::<span style=\"color: #000000;\">IID_ISampleGrabber</span>, <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pSampleGrabber<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not get ISampleGrabber interface to sample grabber filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Enable sample buffering in the sample grabber filter</span><br />&nbsp; &nbsp; hr = pSampleGrabber->SetBufferSamples<span style=\"color: #000000;\">&#40;</span><span style=\"color: #00C800;\">TRUE</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not enable sample buffering in the sample grabber\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Set media type in sample grabber filter</span><br />&nbsp; &nbsp; AM_MEDIA_TYPE mt;<br />&nbsp; &nbsp; ZeroMemory<span style=\"color: #000000;\">&#40;</span>&mt, sizeof<span style=\"color: #000000;\">&#40;</span>AM_MEDIA_TYPE<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; mt.majortype = MEDIATYPE_Video;<br />&nbsp; &nbsp; mt.subtype = MEDIASUBTYPE_RGB24;<br />&nbsp; &nbsp; hr = pSampleGrabber->SetMediaType<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#40;</span>DexterLib::_AMMediaType *<span style=\"color: #000000;\">&#41;</span>&mt<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not set media type in sample grabber\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Add sample grabber filter to filter graph</span><br />&nbsp; &nbsp; hr = pGraph->AddFilter<span style=\"color: #000000;\">&#40;</span>pSampleGrabberFilter, L<span style=\"color: #ff0000;\">\"SampleGrab\"</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not add Sample Grabber to filter graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Create Null Renderer filter</span><br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span>CLSID_NullRenderer, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_IBaseFilter,<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pNullRenderer<span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not create Null Renderer filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Add Null Renderer filter to filter graph</span><br />&nbsp; &nbsp; hr = pGraph->AddFilter<span style=\"color: #000000;\">&#40;</span>pNullRenderer, L<span style=\"color: #ff0000;\">\"NullRender\"</span><span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not add Null Renderer to filter graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style=\"color: #B900B9;\">// Connect up the filter graph's capture stream</span><br />&nbsp; &nbsp; hr = pBuilder->RenderStream<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video,<br />&nbsp; &nbsp; &nbsp; &nbsp; pCap, &nbsp;pSampleGrabberFilter, pNullRenderer<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not render capture video stream\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; hr = pBuilder->RenderStream<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pCap, <span style=\"color: #00C800;\">NULL</span>, <span style=\"color: #00C800;\">NULL</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; <br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr != S_OK && hr != VFW_S_NOPREVIEWPIN<span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not render preview video stream\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get media control interfaces to graph builder object</span><br />&nbsp; &nbsp; hr = pGraph->QueryInterface<span style=\"color: #000000;\">&#40;</span>IID_IMediaControl,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pMediaControl<span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span> <br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not get media control interface\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Run graph</span><br />&nbsp; &nbsp; <span style=\"color: #00C800;\">while</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span><span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; hr = pMediaControl->Run<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Hopefully, the return value was S_OK or S_FALSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr == S_OK<span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">break</span>; <span style=\"color: #B900B9;\">// graph is now running</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr == S_FALSE<span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">continue</span>; <span style=\"color: #B900B9;\">// graph still preparing to run</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// If the Run function returned something else,</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// there must be a problem</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// fprintf(stderr, \"Error: %u\\n\", hr);</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not run filter graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;hb_retnll<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">&#40;</span> HB_LONGLONG <span style=\"color: #000000;\">&#41;</span> pMediaControl <span style=\"color: #000000;\">&#41;</span>;<br /><span style=\"color: #000000;\">&#125;</span><br /><br /><span style=\"color: #00D7D7;\">#pragma</span> ENDDUMP</div>[/code:2j9zuf43]", "time": "19:22", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "We don't need to stop the camera to take the photo, so we can simply do:\n\n oCamera:bLClicked = { || TakePhoto( oCamera ) }", "time": "19:24", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "File updated:\n\n[url:b02c660a]https&#58;//bitbucket&#46;org/fivetech/fivewin-contributions/downloads/dshow&#46;prg[/url:b02c660a]", "time": "19:25", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "Removed warnings and EXE included:\n\n[url:1f5gihfi]https&#58;//bitbucket&#46;org/fivetech/fivewin-contributions/downloads/dshow&#46;zip[/url:1f5gihfi]", "time": "19:51", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "OK ... that is running and building fine here ( from the .prg included in the .zip file ).\n\nTim", "time": "20:19", "topic": "Camera Control needed for Tablet", "username": "TimStone" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "On my Microsoft Surface Pro 3 with Windows 10 dshow.exe gets error.\n\"Could not render preview video stream\"\ndshow.exe was in the last .zip file you linked to.", "time": "22:00", "topic": "Camera Control needed for Tablet", "username": "Gale FORd" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "My Microsoft Surface 3 with the current Win 10 works fine with dShow.exe", "time": "22:21", "topic": "Camera Control needed for Tablet", "username": "TimStone" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "Tim, Gale,\n\nAre you using different Windows builds ?", "time": "22:38", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "I am using Microsoft Windows 10 Pro\nVersion 10.0.10586 Build 10586\nx64-based PC\n\nI will try running it on our Panasonic Touphpad with Windows 10 Pro x86 version", "time": "22:45", "topic": "Camera Control needed for Tablet", "username": "Gale FORd" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "Antonio,\n\nOn my Surface 3 ( not the pro model ), I just did a complete fresh re-install so it is the actual Anniversary release. I did it yesterday. It shows as Home: 14393.82\n\nOn my desktop, it is also working. This is an Insider Fast machine, build 14095.rs_prelease.160811-1739.", "time": "22:57", "topic": "Camera Control needed for Tablet", "username": "TimStone" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "Works ok on Panasonic ToughPad \nWindows 10 Pro 64bit\nSame windows build as the one on my Surface Pro 3.\nDshow defaults to camera 2 that faces user.", "time": "23:00", "topic": "Camera Control needed for Tablet", "username": "Gale FORd" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "Gale,\n\n[quote=\"Gale FORd\":igb3zoqn]On my Microsoft Surface Pro 3 with Windows 10 dshow.exe gets error.\n\"Could not render preview video stream\"\ndshow.exe was in the last .zip file you linked to.[/quote:igb3zoqn]\n\nAfter the error, is the app working fine ?", "time": "23:19", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-25", "forum": "FiveWin for Harbour/xHarbour", "text": "It shows a black square box inside the dialog. If I click on black square it creates another black square beside it.\nIt also creates a 352kb photo.bmp but the image seems to be empty.", "time": "23:38", "topic": "Camera Control needed for Tablet", "username": "Gale FORd" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-26", "forum": "FiveWin for Harbour/xHarbour", "text": "Gale,\n\nCould you run this utility on your surface to see if it helps ?\n\n[url:37ho8yd9]http&#58;//error-toolkit&#46;com/error&#46;php?t=638[/url:37ho8yd9]", "time": "00:01", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-29", "forum": "FiveWin for Harbour/xHarbour", "text": "Antonio,\n\nLooks like we have a start for a FWH camera control. You used a SaveToBMP( ) but actually we would benefit by saving pictures to an alternative file, ie. JPG. \n\nTim", "time": "22:23", "topic": "Camera Control needed for Tablet", "username": "TimStone" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-29", "forum": "FiveWin for Harbour/xHarbour", "text": "Tim,\n\nA first version\n\ntcamera.prg\n[code=fw:29ls6iz5]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><span style=\"color: #00D7D7;\">#include</span> <span style=\"color: #ff0000;\">\"FiveWin.ch\"</span><br /><br /><span style=\"color: #00D7D7;\">#define</span> GWL_STYLE <span style=\"color: #000000;\">-16</span><br /><br /><span style=\"color: #00C800;\">function</span> Main<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">local</span> oWnd, oCamera<br /><br />&nbsp; &nbsp;<span style=\"color: #0000ff;\">DEFINE</span> <span style=\"color: #0000ff;\">WINDOW</span> oWnd<br /><br />&nbsp; &nbsp;oCamera = TCamera<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>:<span style=\"color: #00C800;\">New</span><span style=\"color: #000000;\">&#40;</span> oWnd <span style=\"color: #000000;\">&#41;</span><br /><br />&nbsp; &nbsp;oCamera:<span style=\"color: #000000;\">bLClicked</span> = <span style=\"color: #000000;\">&#123;</span> || oCamera:<span style=\"color: #000000;\">SaveToBmp</span><span style=\"color: #000000;\">&#40;</span> <span style=\"color: #ff0000;\">\"photo.bmp\"</span> <span style=\"color: #000000;\">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WinExec<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #ff0000;\">\"mspaint photo.bmp\"</span> <span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#125;</span><br /><br />&nbsp; &nbsp;<span style=\"color: #0000ff;\">ACTIVATE</span> <span style=\"color: #0000ff;\">WINDOW</span> oWnd<br /><br /><span style=\"color: #00C800;\">return</span> <span style=\"color: #00C800;\">nil</span> &nbsp; <br /><br /><span style=\"color: #00C800;\">CLASS</span> TCamera <span style=\"color: #0000ff;\">FROM</span> TControl<br /><br />&nbsp; &nbsp;CLASSDATA lRegistered AS LOGICAL<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">DATA</span> pMediaControl<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">METHOD</span> <span style=\"color: #00C800;\">New</span><span style=\"color: #000000;\">&#40;</span> oWndParent, nTop, nLeft, nBottom, nRight <span style=\"color: #000000;\">&#41;</span><br /><br /><span style=\"color: #00C800;\">ENDCLASS</span><br /><br /><span style=\"color: #00C800;\">METHOD</span> <span style=\"color: #00C800;\">New</span><span style=\"color: #000000;\">&#40;</span> oWndParent, nTop, nLeft, nBottom, nRight <span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">CLASS</span> TCamera<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">DEFAULT</span> nTop := <span style=\"color: #000000;\">15</span>, nLeft := <span style=\"color: #000000;\">15</span>, nBottom := <span style=\"color: #000000;\">300</span>, nRight := <span style=\"color: #000000;\">300</span><br /><br />&nbsp; &nbsp;::<span style=\"color: #000000;\">pMediaControl</span> = DShowCamera<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br /><br />&nbsp; &nbsp;::<span style=\"color: #000000;\">hWnd</span> &nbsp;= FindWindow<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"ActiveMovie Window\"</span> <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp;::<span style=\"color: #000000;\">oWnd</span> &nbsp;= oWndParent <br />&nbsp; &nbsp;::<span style=\"color: #000000;\">nTop</span> &nbsp;= nTop<br />&nbsp; &nbsp;::<span style=\"color: #000000;\">nLeft</span> = nLeft<br />&nbsp; &nbsp;::<span style=\"color: #000000;\">nBottom</span> = nBottom<br />&nbsp; &nbsp;::<span style=\"color: #000000;\">nRight</span> &nbsp;= nRight<br /><br />&nbsp; &nbsp;SetParent<span style=\"color: #000000;\">&#40;</span> ::<span style=\"color: #000000;\">hWnd</span>, ::<span style=\"color: #000000;\">oWnd</span>:<span style=\"color: #000000;\">hWnd</span> <span style=\"color: #000000;\">&#41;</span> <br />&nbsp; &nbsp;SetWindowLong<span style=\"color: #000000;\">&#40;</span> ::<span style=\"color: #000000;\">hWnd</span>, GWL_STYLE, nOr<span style=\"color: #000000;\">&#40;</span> WS_CHILD, WS_VISIBLE <span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp;SetWindowPos<span style=\"color: #000000;\">&#40;</span> ::<span style=\"color: #000000;\">hWnd</span>, <span style=\"color: #000000;\">0</span>, nTop, nLeft, nBottom, nRight <span style=\"color: #000000;\">&#41;</span><br /><br />&nbsp; &nbsp;::<span style=\"color: #000000;\">Register</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp;::<span style=\"color: #000000;\">Link</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br /><br /><span style=\"color: #00C800;\">return</span> <span style=\"color: #00C800;\">Self</span><br /><br /><span style=\"color: #00D7D7;\">#pragma</span> BEGINDUMP<br /><br /><span style=\"color: #00D7D7;\">#pragma</span> warning<span style=\"color: #000000;\">&#40;</span>disable:<span style=\"color: #000000;\">4996</span><span style=\"color: #000000;\">&#41;</span><br /><br /><span style=\"color: #00D7D7;\">#include</span> <hbapi.h><br /><span style=\"color: #00D7D7;\">#include</span> <dshow.h><br /><span style=\"color: #00D7D7;\">#include</span> <uuids.h><br /><span style=\"color: #00D7D7;\">#include</span> <objbase.h><br /><br />#import <span style=\"color: #ff0000;\">\"qedit.dll\"</span> raw_interfaces_only named_guids<br /><br />EXTERN_C const CLSID CLSID_NullRenderer;<br />EXTERN_C const CLSID CLSID_SampleGrabber;<br /><br /><span style=\"color: #00C800;\">HB_FUNC</span><span style=\"color: #000000;\">&#40;</span> DSHOWPLAY <span style=\"color: #000000;\">&#41;</span><br /><span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp;IMediaControl * pMediaControl = <span style=\"color: #000000;\">&#40;</span> IMediaControl * <span style=\"color: #000000;\">&#41;</span> hb_parnll<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">1</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;pMediaControl->Run<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>;<br /><span style=\"color: #000000;\">&#125;</span> &nbsp; <br /><br /><span style=\"color: #00C800;\">HB_FUNC</span><span style=\"color: #000000;\">&#40;</span> DSHOWSTOP <span style=\"color: #000000;\">&#41;</span><br /><span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp;IMediaControl * pMediaControl = <span style=\"color: #000000;\">&#40;</span> IMediaControl * <span style=\"color: #000000;\">&#41;</span> hb_parnll<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">1</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;pMediaControl->Stop<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>;<br /><span style=\"color: #000000;\">&#125;</span> &nbsp; <br /><br /><span style=\"color: #00C800;\">HB_FUNC</span><span style=\"color: #000000;\">&#40;</span> DSHOWCAMERA <span style=\"color: #000000;\">&#41;</span><br /><span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp;HRESULT hr;<br />&nbsp; &nbsp;ICreateDevEnum *pDevEnum = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IEnumMoniker *pEnum = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IMoniker *pMoniker = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IPropertyBag *pPropBag = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IGraphBuilder *pGraph = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;ICaptureGraphBuilder2 *pBuilder = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pCap = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pSampleGrabberFilter = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IBaseFilter *pNullRenderer = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;IMediaControl *pMediaControl = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;char *pBuffer = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp;VARIANT <span style=\"color: #0000ff;\">var</span>;<br />&nbsp; &nbsp; int n = <span style=\"color: #000000;\">0</span>;<br />&nbsp; &nbsp; int device_number = <span style=\"color: #000000;\">0</span>;<br />&nbsp; &nbsp; char device_name<span style=\"color: #000000;\">&#91;</span> <span style=\"color: #000000;\">100</span> <span style=\"color: #000000;\">&#93;</span>;<br />&nbsp; &nbsp;char char_buffer<span style=\"color: #000000;\">&#91;</span><span style=\"color: #000000;\">100</span><span style=\"color: #000000;\">&#93;</span>;<br />&nbsp; &nbsp;DexterLib::<span style=\"color: #000000;\">ISampleGrabber</span> *pSampleGrabber = <span style=\"color: #00C800;\">NULL</span>;<br /><br />&nbsp; &nbsp;strcpy<span style=\"color: #000000;\">&#40;</span> device_name, <span style=\"color: #ff0000;\">\"\"</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;hr = CoInitializeEx<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #00C800;\">NULL</span>, COINIT_MULTITHREADED <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoInitializeEx error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_FilterGraph, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_IGraphBuilder,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span> void ** <span style=\"color: #000000;\">&#41;</span> &pGraph <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoCreateInstance error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_CaptureGraphBuilder2, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_ICaptureGraphBuilder2,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span> void ** <span style=\"color: #000000;\">&#41;</span> &pBuilder <span style=\"color: #000000;\">&#41;</span>; &nbsp; &nbsp; &nbsp;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoCreateInstance 2 error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; hr = <span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">&#40;</span> ICaptureGraphBuilder * <span style=\"color: #000000;\">&#41;</span> pBuilder <span style=\"color: #000000;\">&#41;</span>->SetFiltergraph<span style=\"color: #000000;\">&#40;</span> pGraph <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not attach capture graph builder to graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; <br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> CLSID_SystemDeviceEnum, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span> &pDevEnum <span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not crerate system device enumerator\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; hr = pDevEnum->CreateClassEnumerator<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLSID_VideoInputDeviceCategory, &pEnum, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"No video devices found\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; <span style=\"color: #00C800;\">while</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span><span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Access next device</span><br />&nbsp; &nbsp; &nbsp; &nbsp; hr = pEnum->Next<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span>, &pMoniker, <span style=\"color: #00C800;\">NULL</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr == S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; n++; <span style=\"color: #B900B9;\">// increment device count</span><br />&nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// If device was specified by name rather than number...</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> device_number == <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get video input device name</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hr = pMoniker->BindToStorage<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span>&pPropBag<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr == S_OK<span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get current device name</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VariantInit<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hr = pPropBag->Read<span style=\"color: #000000;\">&#40;</span>L<span style=\"color: #ff0000;\">\"FriendlyName\"</span>, &var, <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Convert to a normal C string, i.e. char*</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sprintf<span style=\"color: #000000;\">&#40;</span>char_buffer, <span style=\"color: #ff0000;\">\"%ls\"</span>, <span style=\"color: #0000ff;\">var</span>.bstrVal<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VariantClear<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pPropBag->Release<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pPropBag = <span style=\"color: #00C800;\">NULL</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Exit loop if current device name matched devname</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// MessageBox( 0, char_buffer, \"device_name\", 0 );</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span><span style=\"color: #0000ff;\">strcmp</span><span style=\"color: #000000;\">&#40;</span>device_name, char_buffer<span style=\"color: #000000;\">&#41;</span> == <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Error getting device names\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #000000;\">&#125;</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">else</span> <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>n >= device_number<span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">break</span>;<br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span> &nbsp; <br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get video input device name</span><br />&nbsp; &nbsp; hr = pMoniker->BindToStorage<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>, IID_PPV_ARGS<span style=\"color: #000000;\">&#40;</span>&pPropBag<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; VariantInit<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; hr = pPropBag->Read<span style=\"color: #000000;\">&#40;</span>L<span style=\"color: #ff0000;\">\"FriendlyName\"</span>, &var, <span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// MessageBoxW( 0, L\"Capture device\", var.bstrVal, 0 );</span><br />&nbsp; &nbsp; VariantClear<span style=\"color: #000000;\">&#40;</span>&var<span style=\"color: #000000;\">&#41;</span>; &nbsp; <br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Create capture filter and add to graph</span><br />&nbsp; &nbsp; hr = pMoniker->BindToObject<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">0</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IID_IBaseFilter, <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pCap<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span> <br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not create capture filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>; &nbsp; <br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Add capture filter to graph</span><br />&nbsp; &nbsp; hr = pGraph->AddFilter<span style=\"color: #000000;\">&#40;</span>pCap, L<span style=\"color: #ff0000;\">\"Capture Filter\"</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span> <br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not add capture filter to graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Create sample grabber filter</span><br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span>CLSID_SampleGrabber, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_IBaseFilter,<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pSampleGrabberFilter<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not create Sample Grabber filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Query the ISampleGrabber interface of the sample grabber filter</span><br />&nbsp; &nbsp; hr = pSampleGrabberFilter->QueryInterface<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DexterLib::<span style=\"color: #000000;\">IID_ISampleGrabber</span>, <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pSampleGrabber<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not get ISampleGrabber interface to sample grabber filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Enable sample buffering in the sample grabber filter</span><br />&nbsp; &nbsp; hr = pSampleGrabber->SetBufferSamples<span style=\"color: #000000;\">&#40;</span><span style=\"color: #00C800;\">TRUE</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not enable sample buffering in the sample grabber\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Set media type in sample grabber filter</span><br />&nbsp; &nbsp; AM_MEDIA_TYPE mt;<br />&nbsp; &nbsp; ZeroMemory<span style=\"color: #000000;\">&#40;</span>&mt, sizeof<span style=\"color: #000000;\">&#40;</span>AM_MEDIA_TYPE<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; mt.majortype = MEDIATYPE_Video;<br />&nbsp; &nbsp; mt.subtype = MEDIASUBTYPE_RGB24;<br />&nbsp; &nbsp; hr = pSampleGrabber->SetMediaType<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#40;</span>DexterLib::_AMMediaType *<span style=\"color: #000000;\">&#41;</span>&mt<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not set media type in sample grabber\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Add sample grabber filter to filter graph</span><br />&nbsp; &nbsp; hr = pGraph->AddFilter<span style=\"color: #000000;\">&#40;</span>pSampleGrabberFilter, L<span style=\"color: #ff0000;\">\"SampleGrab\"</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not add Sample Grabber to filter graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Create Null Renderer filter</span><br />&nbsp; &nbsp; hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span>CLSID_NullRenderer, <span style=\"color: #00C800;\">NULL</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; CLSCTX_INPROC_SERVER, IID_IBaseFilter,<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pNullRenderer<span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not create Null Renderer filter\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Add Null Renderer filter to filter graph</span><br />&nbsp; &nbsp; hr = pGraph->AddFilter<span style=\"color: #000000;\">&#40;</span>pNullRenderer, L<span style=\"color: #ff0000;\">\"NullRender\"</span><span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not add Null Renderer to filter graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style=\"color: #B900B9;\">// Connect up the filter graph's capture stream</span><br />&nbsp; &nbsp; hr = pBuilder->RenderStream<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video,<br />&nbsp; &nbsp; &nbsp; &nbsp; pCap, &nbsp;pSampleGrabberFilter, pNullRenderer<span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not render capture video stream\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; hr = pBuilder->RenderStream<span style=\"color: #000000;\">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pCap, <span style=\"color: #00C800;\">NULL</span>, <span style=\"color: #00C800;\">NULL</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; <br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr != S_OK && hr != VFW_S_NOPREVIEWPIN<span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not render preview video stream\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Get media control interfaces to graph builder object</span><br />&nbsp; &nbsp; hr = pGraph->QueryInterface<span style=\"color: #000000;\">&#40;</span>IID_IMediaControl,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #000000;\">&#40;</span>void**<span style=\"color: #000000;\">&#41;</span>&pMediaControl<span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span> <br />&nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not get media control interface\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style=\"color: #B900B9;\">// Run graph</span><br />&nbsp; &nbsp; <span style=\"color: #00C800;\">while</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1</span><span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; hr = pMediaControl->Run<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// Hopefully, the return value was S_OK or S_FALSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr == S_OK<span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">break</span>; <span style=\"color: #B900B9;\">// graph is now running</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>hr == S_FALSE<span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">continue</span>; <span style=\"color: #B900B9;\">// graph still preparing to run</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// If the Run function returned something else,</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// there must be a problem</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #B900B9;\">// fprintf(stderr, \"Error: %u\\n\", hr);</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"Could not run filter graph\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />&nbsp; &nbsp; <span style=\"color: #000000;\">&#125;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;hb_retnll<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">&#40;</span> HB_LONGLONG <span style=\"color: #000000;\">&#41;</span> pMediaControl <span style=\"color: #000000;\">&#41;</span>;<br /><span style=\"color: #000000;\">&#125;</span><br /><br /><span style=\"color: #00D7D7;\">#pragma</span> ENDDUMP</div>[/code:29ls6iz5]", "time": "23:00", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-29", "forum": "FiveWin for Harbour/xHarbour", "text": "Methods Play and Stop:\n\n[code=fw:2nr671bv]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><span style=\"color: #00C800;\">CLASS</span> TCamera <span style=\"color: #0000ff;\">FROM</span> TControl<br /><br />&nbsp; &nbsp;CLASSDATA lRegistered AS LOGICAL<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">DATA</span> pMediaControl<br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">METHOD</span> <span style=\"color: #00C800;\">New</span><span style=\"color: #000000;\">&#40;</span> oWndParent, nTop, nLeft, nBottom, nRight <span style=\"color: #000000;\">&#41;</span><br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">METHOD</span> Play<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">INLINE</span> DShowPlay<span style=\"color: #000000;\">&#40;</span> ::<span style=\"color: #000000;\">pMediaControl</span> <span style=\"color: #000000;\">&#41;</span><br /><br />&nbsp; &nbsp;<span style=\"color: #00C800;\">METHOD</span> Stop<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span> <span style=\"color: #00C800;\">INLINE</span> DShowStop<span style=\"color: #000000;\">&#40;</span> ::<span style=\"color: #000000;\">pMediaControl</span> <span style=\"color: #000000;\">&#41;</span><br /><br /><span style=\"color: #00C800;\">ENDCLASS</span><br />&nbsp;</div>[/code:2nr671bv]", "time": "23:05", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-30", "forum": "FiveWin for Harbour/xHarbour", "text": "Antonio:\n\nI tried to compile tcamera.prg using FW 16.06 and BCC7 and I got the following errors:\n[code=fw:3dakw6d0]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\">Error E2342 TCAMERA.prg <span style=\"color: #000000;\">239</span>: <span style=\"color: #000000;\">Type</span> mismatch in parameter <span style=\"color: #ff0000;\">'rclsid'</span> <span style=\"color: #000000;\">&#40;</span>wanted <span style=\"color: #ff0000;\">'const_GUID * const'</span>, got <span style=\"color: #ff0000;\">'_GUID'</span><span style=\"color: #000000;\">&#41;</span> in <span style=\"color: #00C800;\">function</span> HB_FUN_DSHOWCAMERA<br />Error E2451 TCAMERA.prg <span style=\"color: #000000;\">245</span>: <span style=\"color: #000000;\">Undefined</span> symbol <span style=\"color: #ff0000;\">'AddFilter'</span> in <span style=\"color: #00C800;\">function</span> HB_FUN_DSHOWCAMERA<br />Error E2451 TCAMERA.prg <span style=\"color: #000000;\">251</span>: <span style=\"color: #000000;\">Undefined</span> symbol <span style=\"color: #ff0000;\">'RenderStream'</span> in <span style=\"color: #00C800;\">function</span> HB_FUN_DSHOWCAMERA<br />Error E2451 TCAMERA.prg <span style=\"color: #000000;\">258</span>: <span style=\"color: #000000;\">Undefined</span> symbol <span style=\"color: #ff0000;\">'RenderStream'</span> in <span style=\"color: #00C800;\">function</span> HB_FUN_DSHOWCAMERA<br />Error E2451 TCAMERA.prg <span style=\"color: #000000;\">266</span>: <span style=\"color: #000000;\">Undefined</span> symbol <span style=\"color: #ff0000;\">'QueryInterface'</span> in <span style=\"color: #00C800;\">function</span> HB_FUN_DSHOWCAMERA<br />Error E2451 TCAMERA.prg <span style=\"color: #000000;\">275</span>: <span style=\"color: #000000;\">Undefined</span> symbol <span style=\"color: #ff0000;\">'Run'</span> in <span style=\"color: #00C800;\">function</span> HB_FUN_DSHOWCAMERA<br />Warning W8004 TCAMERA.prg <span style=\"color: #000000;\">288</span>: <span style=\"color: #ff0000;\">'pBuffer'</span> is assigned a value that is never used in <span style=\"color: #00C800;\">function</span> HB_FUN_DSHOWCAMERA<br />Warning W8004 TCAMERA.prg <span style=\"color: #000000;\">288</span>: <span style=\"color: #ff0000;\">'pCap'</span> is assigned a value that is never used in <span style=\"color: #00C800;\">function</span> HB_FUN_DSHOWCAMERA<br />Warning W8004 TCAMERA.prg <span style=\"color: #000000;\">288</span>: <span style=\"color: #ff0000;\">'pPropBag'</span> is assigned a value that is never used in <span style=\"color: #00C800;\">function</span> HB_FUN_DSHOWCAMERA<br />Warning W8004 TCAMERA.prg <span style=\"color: #000000;\">288</span>: <span style=\"color: #ff0000;\">'pMoniker'</span> is assigned a value that is never used in <span style=\"color: #00C800;\">function</span> HB_FUN_DSHOWCAMERA<br />Warning W8004 TCAMERA.prg <span style=\"color: #000000;\">288</span>: <span style=\"color: #ff0000;\">'pEnum'</span> is assigned a value that is never used in <span style=\"color: #00C800;\">function</span> HB_FUN_DSHOWCAMERA<br />Warning W8004 TCAMERA.prg <span style=\"color: #000000;\">288</span>: <span style=\"color: #ff0000;\">'pDevEnum'</span> is assigned a value that is never used in <span style=\"color: #00C800;\">function</span> HB_FUN_DSHOWCAMERA<br />*** <span style=\"color: #000000;\">35</span> errors in Compile ***<br />* Linking errors *</div>[/code:3dakw6d0]\n\nWhat I am missing ? Thank you very much !!!", "time": "06:31", "topic": "Camera Control needed for Tablet", "username": "HunterEC" } ]
Camera Control needed for Tablet
[ { "date": "2016-08-30", "forum": "FiveWin for Harbour/xHarbour", "text": "Gustavo,\n\nIt only works with Microsoft Visual Studio Community 2015", "time": "07:14", "topic": "Camera Control needed for Tablet", "username": "Antonio Linares" } ]
Camera Control needed for Tablet
[ { "date": "2018-01-10", "forum": "FiveWin for Harbour/xHarbour", "text": "Dear Antonio\n\nI found this <!-- m --><a class=\"postlink\" href=\"http://www.rohitab.com/discuss/topic/34389-directshow-webcam-capture-class-c/\">http://www.rohitab.com/discuss/topic/34 ... e-class-c/</a><!-- m -->\n\nperhaps it can be usefull to use it for borland", "time": "10:50", "topic": "Camera Control needed for Tablet", "username": "Silvio.Falconi" } ]
Camera Control needed for Tablet
[ { "date": "2018-01-10", "forum": "FiveWin for Harbour/xHarbour", "text": "Can you make a version to compile with harbour bcc7 for win10pro ?\nor a version with a dll or lib we can use it \ni have a tablet and i need it thanks", "time": "10:07", "topic": "Camera Control needed for Tablet", "username": "Silvio.Falconi" } ]
Camera Control needed for Tablet
[ { "date": "2018-01-11", "forum": "FiveWin for Harbour/xHarbour", "text": "Silvio,\n\nThe application requires files only available with the Microsoft Visual Studio Community edition. It will not work with the Pelles compiler ( xHarbour xBuilder ), or Borland. The resources are not available in those programs.\n\nThe program was developed using VSC 2015 but works fine with VSC 2017 also.\n\nTim", "time": "19:38", "topic": "Camera Control needed for Tablet", "username": "TimStone" } ]
Camera Control needed for Tablet
[ { "date": "2018-01-12", "forum": "FiveWin for Harbour/xHarbour", "text": "[quote=\"Antonio Linares\":17ekvfq8]First steps using Borland (some changes are required for MSVC)\n\n[code=fw:17ekvfq8]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><span style=\"color: #00D7D7;\">#include</span> <span style=\"color: #ff0000;\">\"FiveWin.ch\"</span><br /><br /><span style=\"color: #00C800;\">function</span> Main<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br /><br />   DShowCamera<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br /><br /><span style=\"color: #00C800;\">return</span> <span style=\"color: #00C800;\">nil</span><br /><br /><span style=\"color: #00D7D7;\">#pragma</span> BEGINDUMP<br /><br /><span style=\"color: #00D7D7;\">#include</span> <dshow.h><br /><span style=\"color: #00D7D7;\">#include</span> <uuids.h><br /><br /><span style=\"color: #00C800;\">HB_FUNC</span><span style=\"color: #000000;\">&#40;</span> DSHOWCAMERA <span style=\"color: #000000;\">&#41;</span><br /><span style=\"color: #000000;\">&#123;</span><br />   HRESULT hr;<br />   ICreateDevEnum *pDevEnum = <span style=\"color: #00C800;\">NULL</span>;<br />   IEnumMoniker *pEnum = <span style=\"color: #00C800;\">NULL</span>;<br />   IMoniker *pMoniker = <span style=\"color: #00C800;\">NULL</span>;<br />   IPropertyBag *pPropBag = <span style=\"color: #00C800;\">NULL</span>;<br />   IGraphBuilder *pGraph = <span style=\"color: #00C800;\">NULL</span>;<br />   ICaptureGraphBuilder2 *pBuilder = <span style=\"color: #00C800;\">NULL</span>;<br />   IBaseFilter *pCap = <span style=\"color: #00C800;\">NULL</span>;<br />   IBaseFilter *pSampleGrabberFilter = <span style=\"color: #00C800;\">NULL</span>;<br />   IBaseFilter *pNullRenderer = <span style=\"color: #00C800;\">NULL</span>;<br />   IMediaControl *pMediaControl = <span style=\"color: #00C800;\">NULL</span>;<br />   char *pBuffer = <span style=\"color: #00C800;\">NULL</span>;<br /><br />   hr = CoInitializeEx<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #00C800;\">NULL</span>, COINIT_MULTITHREADED <span style=\"color: #000000;\">&#41;</span>;<br /><br />   <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />      MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoInitializeEx error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />   hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> &CLSID_FilterGraph, <span style=\"color: #00C800;\">NULL</span>,<br />              CLSCTX_INPROC_SERVER, &IID_IGraphBuilder,<br />              <span style=\"color: #000000;\">&#40;</span> void ** <span style=\"color: #000000;\">&#41;</span> &pGraph <span style=\"color: #000000;\">&#41;</span>;<br />           <br />   <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />      MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoCreateInstance error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />      <br />   <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> pGraph != <span style=\"color: #00C800;\">NULL</span> <span style=\"color: #000000;\">&#41;</span><br />      MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"pGraph seems ok\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br />      <br />    hr = CoCreateInstance<span style=\"color: #000000;\">&#40;</span> &CLSID_CaptureGraphBuilder2, <span style=\"color: #00C800;\">NULL</span>,<br />            CLSCTX_INPROC_SERVER, &IID_ICaptureGraphBuilder2,<br />            <span style=\"color: #000000;\">&#40;</span> void ** <span style=\"color: #000000;\">&#41;</span> &pBuilder <span style=\"color: #000000;\">&#41;</span>;      <br /><br />   <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> hr != S_OK <span style=\"color: #000000;\">&#41;</span><br />      MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"CoCreateInstance 2 error\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><br />   <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">&#40;</span> pBuilder != <span style=\"color: #00C800;\">NULL</span> <span style=\"color: #000000;\">&#41;</span><br />      MessageBox<span style=\"color: #000000;\">&#40;</span> <span style=\"color: #000000;\">0</span>, <span style=\"color: #ff0000;\">\"pBuilder seems ok\"</span>, <span style=\"color: #ff0000;\">\"ok\"</span>, <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">&#41;</span>;<br /><span style=\"color: #000000;\">&#125;</span><br /><br /><span style=\"color: #00D7D7;\">#pragma</span> ENDDUMP</div>[/code:17ekvfq8][/quote:17ekvfq8]\n\nthis first release of Linares can be compiled under borland and harbour and run on win10 \nonly there are not the command play and save", "time": "09:17", "topic": "Camera Control needed for Tablet", "username": "Silvio.Falconi" } ]
Camera Control needed for Tablet
[ { "date": "2018-01-15", "forum": "FiveWin for Harbour/xHarbour", "text": "Can we call Dll functions for Intel Cameras ( directshow) ?\n\n<!-- m --><a class=\"postlink\" href=\"https://www.codeproject.com/Articles/330177/Yet-another-Web-Camera-control\">https://www.codeproject.com/Articles/33 ... ra-control</a><!-- m -->\n\n<!-- m --><a class=\"postlink\" href=\"https://msdn.microsoft.com/en-us/library/windows/desktop/dd375454(v=vs.85\">https://msdn.microsoft.com/en-us/librar ... 54(v=vs.85</a><!-- m -->).aspx", "time": "12:50", "topic": "Camera Control needed for Tablet", "username": "Silvio.Falconi" } ]
Camera Control needed for Tablet
[ { "date": "2009-07-09", "forum": "FiveWin para Harbour/xHarbour", "text": "Una pregunta tonta. ¿que significa el puntito negro sobre la campanita del foro?\n\nGracias", "time": "20:35", "topic": "Campanita", "username": "antolin" } ]
Campanita
[ { "date": "2009-07-09", "forum": "FiveWin para Harbour/xHarbour", "text": "Antolin,\n\nEso significa que tu has posteado algo al hilo en cuestion.\n\nAtte.,\n\nLautaro Moreira\nOsorno\nChile", "time": "20:58", "topic": "Campanita", "username": "Lautaro" } ]
Campanita
[ { "date": "2010-03-31", "forum": "FiveWin para Harbour/xHarbour", "text": "Hola amigos:\n\nComo puedo hacer para que un campo de tipo DATE vacio a través de DATEPICKER no me muestre la fecha de hoy ?, ahora cuando el campo DATE en la dbf esta vacio en el diálogo me muestra la fecha de hoy y yo necesito que se muestre vacio.\n\nSaludos\n\nxHarbour\nFWH810\nPellesC", "time": "00:37", "topic": "Campo DATE vacio", "username": "Armando" } ]
Campo DATE vacio
[ { "date": "2010-03-31", "forum": "FiveWin para Harbour/xHarbour", "text": "Armando...\n\nverifica este post \n<!-- l --><a class=\"postlink-local\" href=\"http://forums.fivetechsupport.com/viewtopic.php?t=3181\">viewtopic.php?t=3181</a><!-- l -->", "time": "02:07", "topic": "Campo DATE vacio", "username": "Daniel Garcia-Gil" } ]
Campo DATE vacio
[ { "date": "2010-03-31", "forum": "FiveWin para Harbour/xHarbour", "text": "Daniel:\n\nMuchas gracias por la respuesta, antes de preguntar busque en el foro pero no hallé el post <!-- s:oops: --><img src=\"{SMILIES_PATH}/icon_redface.gif\" alt=\":oops:\" title=\"Embarassed\" /><!-- s:oops: --> \n\nVoy a hacer mis pruebas y te comentaré el resultado.\n\nSaludos", "time": "15:43", "topic": "Campo DATE vacio", "username": "Armando" } ]
Campo DATE vacio
[ { "date": "2010-03-31", "forum": "FiveWin para Harbour/xHarbour", "text": "Daniel y amigos del foro:\n\nEstoy utilizando el TDTpicke.Prg modificado y puesto aquí en el foro sin embargo el control me sigue mostrando la fecha de hoy, lo hice así:\n\n1.- Estoy compilando el TDTPicke.Prg como un programa más de mi aplicación\n2.- Estoy agregando la siguiente línea de código al PRG donde necesito el campo DATE vacio\n[code=fw:2fibcawr]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><br />&nbsp; &nbsp; &nbsp; &nbsp; aGets<span style=\"color: #000000;\">&#91;</span><span style=\"color: #000000;\">12</span><span style=\"color: #000000;\">&#93;</span>:<span style=\"color: #000000;\">lEmptyDate</span> := <span style=\"color: #000000;\">&#40;</span>.T.<span style=\"color: #000000;\">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; aGets<span style=\"color: #000000;\">&#91;</span><span style=\"color: #000000;\">12</span><span style=\"color: #000000;\">&#93;</span>:<span style=\"color: #000000;\">SetDate</span><span style=\"color: #000000;\">&#40;</span> CTOD<span style=\"color: #000000;\">&#40;</span><span style=\"color: #ff0000;\">\" &nbsp;/ &nbsp;/ &nbsp; &nbsp;\"</span><span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#41;</span><br />&nbsp;</div>[/code:2fibcawr]\n\nPero los resultados son los mismos, estoy seguro de que se esta utilizando el TDTPicke.Prg modificado pues le he metido un MsgInfo y sí se muestra.\n\nTengo la impresión de que el problema viene por los recursos, será que debo modificarle algo al recurso, por cierto uso archivo .RES\n\nSaludos y gracias por el apoyo", "time": "16:47", "topic": "Campo DATE vacio", "username": "Armando" } ]
Campo DATE vacio
[ { "date": "2010-03-31", "forum": "FiveWin para Harbour/xHarbour", "text": "Armando...\n\nAl parecer no es posible mostrar vacio el control SysDateTimePick32, siempre mostrara una fecha, pero podrias usar desde recurso SHOW NONE = YES, eso añade un checkbox al control que hara posible no asignar fecha y el campo quede en blanco, siempre y cuando el checkbox este desmarcado.", "time": "18:31", "topic": "Campo DATE vacio", "username": "Daniel Garcia-Gil" } ]
Campo DATE vacio
[ { "date": "2010-04-01", "forum": "FiveWin para Harbour/xHarbour", "text": "Daniel:\n\nLamentablemente no he podido avanzar, con la propiedad SHOWNONE = YES\nme tira un error \"El sistema ha detectado un problema y debe cerrarse\" y no \nse crea el archivo LOG para ver por donde ir.\n\nSería fabuloso encontrar la forma de que la clase original nos permitiera mostrar campos\nde fecha vacios.\n\nSaludos", "time": "16:25", "topic": "Campo DATE vacio", "username": "Armando" } ]
Campo DATE vacio
[ { "date": "2010-04-01", "forum": "FiveWin para Harbour/xHarbour", "text": "Armando.\n\nNo es un problema de la clase, SysDateTimePick32 es un control propio de window y al paracer no esta en sus caracteristicas mostrar vacio el campo\n\nque version de fwh estas usando?", "time": "18:00", "topic": "Campo DATE vacio", "username": "Daniel Garcia-Gil" } ]
Campo DATE vacio
[ { "date": "2010-04-01", "forum": "FiveWin para Harbour/xHarbour", "text": "Daniel:\n\nEntiendo, te comento que el dialogo donde estoy usando esta clase es un dialogo para\nABC de empleados y los campos son Fecha de Ingreso (Siempre debe tener algun valor),\nFecha del último incremento de salario (No siempre tiene valor) y la fecha de baja (tambien\nno siempre debe tener valor).\n\nTal vez la solución va por el uso del Check Box que tiene este control solo que no he podido\nhacerlo funcionar, si algun colega del foro tuviera la solución será muy agradecida.\n\nUso FWH810 y xHarbour\n\nSaludos", "time": "18:58", "topic": "Campo DATE vacio", "username": "Armando" } ]
Campo DATE vacio
[ { "date": "2010-04-01", "forum": "FiveWin para Harbour/xHarbour", "text": "Armando\n\nvoy a tratar de hacer un ejemplo para tu version", "time": "19:53", "topic": "Campo DATE vacio", "username": "Daniel Garcia-Gil" } ]
Campo DATE vacio
[ { "date": "2010-04-01", "forum": "FiveWin para Harbour/xHarbour", "text": "Armando...\n\npara la version que usas ya esta disponible un ejemplo que prueba de forma efectiva el uso correcto del control desde recurso\n\nmira el ejemplo: datetime.prg", "time": "20:06", "topic": "Campo DATE vacio", "username": "Daniel Garcia-Gil" } ]
Campo DATE vacio
[ { "date": "2010-04-01", "forum": "FiveWin para Harbour/xHarbour", "text": "Daniel:\n\nMuchas gracias por tu interés, peroooo <!-- s:oops: --><img src=\"{SMILIES_PATH}/icon_redface.gif\" alt=\":oops:\" title=\"Embarassed\" /><!-- s:oops: --> \n\nHe compilado el ejemplo que me mencionas y no tira error pero en la ejecución me tira\nel famoso error \"El programa ha encontrado un error y debe cerrarse\". <!-- s:twisted: --><img src=\"{SMILIES_PATH}/icon_twisted.gif\" alt=\":twisted:\" title=\"Twisted Evil\" /><!-- s:twisted: --> \n\n\nSaludos", "time": "22:44", "topic": "Campo DATE vacio", "username": "Armando" } ]
Campo DATE vacio
[ { "date": "2010-04-01", "forum": "FiveWin para Harbour/xHarbour", "text": "Armando...\n\nprueba con este ejecutable... esta construido con la version 810\n\n[url:3sapacds]http&#58;//www&#46;sitasoft&#46;net/fivewin/samples/datetime&#46;zip[/url:3sapacds]", "time": "23:54", "topic": "Campo DATE vacio", "username": "Daniel Garcia-Gil" } ]
Campo DATE vacio
[ { "date": "2010-04-02", "forum": "FiveWin para Harbour/xHarbour", "text": "Daniel:\n\nTu ejemplo funciona de 100.\n\nEn mi caso el .RC lo convertí a .RES pues mi aplicación usa ese tipo de archivo, será por eso que me tira el error ?.\n\nPodrías enviarme tu BAT de compilación para probar si es por ahi el problema ?\n\nSaludos", "time": "00:33", "topic": "Campo DATE vacio", "username": "Armando" } ]
Campo DATE vacio
[ { "date": "2010-04-02", "forum": "FiveWin para Harbour/xHarbour", "text": "Armando\n\nuso el default que viene con fwh en la carpeta de samples", "time": "00:50", "topic": "Campo DATE vacio", "username": "Daniel Garcia-Gil" } ]
Campo DATE vacio
[ { "date": "2010-04-02", "forum": "FiveWin para Harbour/xHarbour", "text": "Daniel:\n\nBingo <!-- s:) --><img src=\"{SMILIES_PATH}/icon_smile.gif\" alt=\":)\" title=\"Smile\" /><!-- s:) --> al parecer el problema era porque tengo modificada la clase TGET y por ahí venia el error, he compilado sin esta clase y todo funciona muy bien.\n\nMuy agradecido por tu tiempo e interés.\n\nSaludos", "time": "01:36", "topic": "Campo DATE vacio", "username": "Armando" } ]
Campo DATE vacio
[ { "date": "2010-04-02", "forum": "FiveWin para Harbour/xHarbour", "text": "Armando...\n\n\nmenos mal que diste con el problema, estoy a la orden", "time": "02:20", "topic": "Campo DATE vacio", "username": "Daniel Garcia-Gil" } ]
Campo DATE vacio
[ { "date": "2008-01-16", "forum": "FiveWin para CA-Clipper", "text": "Hola antonio \n\nEn un campo DATE se requiere que cuando el cursor llegue e este despliegue un dialogo en donde pinta el mes y el dia resaltado en forma grafica, como lo puedo hacer en FiveWin.\nEsto con el animo de evitar cometer errores de digitacion\n\nDe antemano Gracias por tus enseñanzas\n\nCordialmente\n\nJairo Barbosa", "time": "01:12", "topic": "Campo Date", "username": "jaba" } ]
Campo Date
[ { "date": "2008-01-16", "forum": "FiveWin para CA-Clipper", "text": "Aqui hay algo que creo puede servir\n\n<!-- m --><a class=\"postlink\" href=\"http://fivetechsoft.com/forums/viewtopic.php?t=8117&highlight=dtpicker\">http://fivetechsoft.com/forums/viewtopi ... t=dtpicker</a><!-- m -->\n\nSaludos", "time": "15:34", "topic": "Campo Date", "username": "leandro" } ]
Campo Date
[ { "date": "2008-01-17", "forum": "FiveWin para CA-Clipper", "text": "[quote=\"leandro\":3t5684ah]Aqui hay algo que creo puede servir\n\n<!-- m --><a class=\"postlink\" href=\"http://fivetechsoft.com/forums/viewtopic.php?t=8117&highlight=dtpicker\">http://fivetechsoft.com/forums/viewtopi ... t=dtpicker</a><!-- m -->\n\nSaludos[/quote:3t5684ah]\n\nLeandro\n\nUn saludo Cordial\n\nQuiero agradecerte la explicacion lo intentare desarrollar\n\nCordialmente\n\nJairo Barbosa", "time": "00:22", "topic": "Campo Date", "username": "jaba" } ]
Campo Date
[ { "date": "2011-05-18", "forum": "FiveWin para Harbour/xHarbour", "text": "Hola a todos:\n\nEstoy utilizando por primera vez los campos MEMO y tengo el siguiente problema:\n\nMientras no se grabe nada en el campo todo va bien pero cuando introduzco un dato en el campo MEMO este en vez de incrementarse lo que se introduce se incrementa a 8Gb, si 8Gb, y no se como se puede corregir ya que creo que no es normal.\n\nEl codigo fuente es muy sencillo ya que lo unico que hago es introducir en la base de datos llamada DEPCUEPR.DBF dos variabes \"CODIGO\" y \"CAMPOME001\". Y quiero añadir un registro de la siguiente manera:\n\nSELECT 49\nuse DEPCUEPR SHARED\nbloqfila()\nappend blank\nreplace codigo with \"010101\"\nreplace campome001 with \"Texto Predefinido Memoria Apartado 1\"\nDbUnlock()\n\ny cuando termina la DBF tiene 2 Kb y el DBT tiene los 8Gb\n\nAlguna sugerencia de lo que estoy haciendo mal para que se ponga en ese tamaño.\n\nUn saludo\n\nCarlos", "time": "13:41", "topic": "Campo MEMO", "username": "colthop" } ]
Campo MEMO
[ { "date": "2011-05-18", "forum": "FiveWin para Harbour/xHarbour", "text": "hola,\n\ncreo que esto no es normal, me gustaría saber como creas la tabla DEPCUEPR.DBF, si utilizas el mítico DBU.EXE de clipper, o algún otro utilitario, o bien, si lo creas por código en tu aplicación, coloca el trozo de programa en donde lo haces, así tendremos un poco mas claro el panorama para poder ayudarte.\n\nsaludos desde Chile", "time": "14:25", "topic": "Campo MEMO", "username": "armando.lagunas" } ]
Campo MEMO
[ { "date": "2011-05-18", "forum": "FiveWin para Harbour/xHarbour", "text": "Hola de nuevo.\n\nHe creado el archivo desde codigo y en vez de crearme un archivo dbt me crea uno ftp y con las primeras puebas funciona aparentemente bien, me podeis comentar:\n\n- Hay alguna diferencia.\n- Es mejor el DBT\n- Si es asi como se puede crear el DBT en vez del FTP desde codigo\n\nPor otra parte se puede separar un texto en dos para imprimirlo en dos paginas diferentes si es mayor de un determinado tamaño.\n\nUn saludo\n\nCarlos", "time": "17:49", "topic": "Campo MEMO", "username": "colthop" } ]
Campo MEMO
[ { "date": "2011-05-18", "forum": "FiveWin para Harbour/xHarbour", "text": "Carlos\n\nhasta donde recuerdo DBT son campos memo originarios del RDD NTX de clipper\ny FTP son los campos memo para el RDD CDX\nlos FTP son mucho mas pequeños que los DBT\nde todas formas 8GB en un DBT es una barbaridad a menos que la base de datos tenga una cantidad enorme de registros", "time": "22:00", "topic": "Campo MEMO", "username": "postinelli" } ]
Campo MEMO
[ { "date": "2011-05-19", "forum": "FiveWin para Harbour/xHarbour", "text": "[quote=\"colthop\":1k94h5db]\n- Hay alguna diferencia.\n- Es mejor el DBT\n- Si es asi como se puede crear el DBT en vez del FTP desde codigo\n[/quote:1k94h5db]\nEs mejor FPT, DBT es el historico formato de Clipper/dbase, FPT es introducido por FoxPro (FPT = Fox Pro Text) junto con los CDX. DBT tenia originalmente un tamaño de bloque de 512 bytes, es decir que sin importar el tamaño del texto siempre se ocupaban múltiplos de 512. Luego las ultimas versiones de clipper introdujeron la posibilidad de cambiar este valor, pero la verdad es que nunca lo probé. \nFPT tiene un tamaño de bloque tambien variable (ver dbinfo() y funciones similares) pero por defecto es de 64, con lo cual resulta siempre mas ajustado. Tambien tiene algunas ventajas en cuanto a la reutilización de espacio liberado, y en general ha resultado más estable que el dbt. \nSe me ocurre que las funciones BLOB tambien te podrían resultar útiles, pero personalmente no he tenido experiencia más alla de alguna prueba. \n\n[quote=\"colthop\":1k94h5db]\nPor otra parte se puede separar un texto en dos para imprimirlo en dos paginas diferentes si es mayor de un determinado tamaño.\n[/quote:1k94h5db]\nPuedes usar las funciones MLCount() y Memoline(), que te devuelven la cantida de lineas y cada línea respectivamente, con lo que podrás ir contando cuantas lineas de texto hay y podrás calcular cuando hay que hacer un salto de hoja.", "time": "10:39", "topic": "Campo MEMO", "username": "Carlos Mora" } ]
Campo MEMO
[ { "date": "2011-05-20", "forum": "FiveWin para Harbour/xHarbour", "text": "Hola de nuevo:\n\nPrimero dar lasgracias por vuestras respuestas y segundo una pregunta mas:\n\n- Tiene algun limite de caracteres ya que he introducido un texto y no me ha entrado.\n\nUn saludo\n\nCarlos", "time": "07:03", "topic": "Campo MEMO", "username": "colthop" } ]
Campo MEMO
[ { "date": "2011-05-20", "forum": "FiveWin para Harbour/xHarbour", "text": "Hola de nuevo:\n\nPrimero dar lasgracias por vuestras respuestas y segundo una pregunta mas:\n\n- Tiene algun limite de caracteres ya que he introducido un texto y no me ha entrado.\n\nUn saludo\n\nCarlos", "time": "07:03", "topic": "Campo MEMO", "username": "colthop" } ]
Campo MEMO
[ { "date": "2011-05-20", "forum": "FiveWin para Harbour/xHarbour", "text": "Hola de nuevo:\n\nrimero dar lasgracias por vuestras respuestas y segundo una pregunta mas:\n\n- Tiene algun limite de caracteres ya que he introducido un texto y no me ha entrado.\n\nUn saludo\n\nCarlos", "time": "07:03", "topic": "Campo MEMO", "username": "colthop" } ]
Campo MEMO
[ { "date": "2011-05-20", "forum": "FiveWin para Harbour/xHarbour", "text": "Hola de nuevo:\n\nPrimero dar las gracias por vuestras respuestas y segundo una pregunta mas:\n\n- Tiene algun limite de caracteres ya que he introducido un texto y no me ha entrado.\n\nUn saludo\n\nCarlos", "time": "07:03", "topic": "Campo MEMO", "username": "colthop" } ]
Campo MEMO
[ { "date": "2011-05-20", "forum": "FiveWin para Harbour/xHarbour", "text": "Hola de nuevo:\n\nPrimero dar las gracias por vuestras respuestas y segundo una pregunta mas:\n\n- Tiene algun limite de caracteres ya que he introducido un texto y no me ha entrado.\n\nUn saludo\n\nCarlos", "time": "07:03", "topic": "Campo MEMO", "username": "colthop" } ]
Campo MEMO
[ { "date": "2011-05-20", "forum": "FiveWin para Harbour/xHarbour", "text": "en Clipper tenía el mismo límite que las strings, aproximadamente 64 Kb, pero en Harbour creo que el límite es mucho más alto, del órden de los GB, no creo que lo estés superando si lo que estas guardando sea texto. ¿Podrías poner algo de código para intentar encontrar el fallo?\nEstoy adivinando que estás guardando los diferentes párrafos de la Memoria del Ejercicio, calculo que el tamaño no debería ser un problema.\n\nUn saludo", "time": "10:13", "topic": "Campo MEMO", "username": "Carlos Mora" } ]
Campo MEMO
[ { "date": "2011-05-20", "forum": "FiveWin para Harbour/xHarbour", "text": "Hola Carlos:\n\nAdjunto te envio el codigo, pasa en dos apartados diferentes y que se necesita el mismo texto son:\n\nAsi cargo los memos en las variables:\nzCampoMe001 = CampoMe001\nva002 = campome001\n\nAsi lo solicito:\n@ 95*ProporV, 35*ProPorH GET gDlg001 VAR zCampoMe001 MEMO OF oDlgwVen PIXEL COLOR escri02, fondo02 FONT oFont SIZE 640*ProPorH, 1050*ProPorV NOBORDER\n@ 10*ProporV, 35*ProPorH GET vDlg151 VAR va002 MEMO OF oDlgwBro PIXEL COLOR escri02, fondo02 FONT oFont SIZE 640*ProPorH, 570*ProPorV NOBORDER\n\ny asi lo reemplazo:\nreplace CampoMe001 with zCampoMe001\nreplace CampoMe001 with va002\n\ny este es el texto[code=fw:1b56b016]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><span style=\"color: #000000;\">4.1</span>. Inmovilizado intangible: <br /><br /><span style=\"color: #000000;\">Los</span> activos intangibles se registran por su coste de adquisición y/o producción y, posteriormente, se valoran a su coste menos, según proceda, su correspondiente amortización acumulada y/o pérdidas por deterioro que hayan experimentado. Dichos activos se amortizan en función de su vida útil. <br /><br />La Sociedad reconoce cualquier pérdida que haya podido producirse en el valor registrado de estos activos con origen en su deterioro, los criterios para el reconocimiento de las pérdidas por deterioro de estos activos y, en su caso, de las recuperaciones de las pérdidas por deterioro registradas en ejercicios anteriores son similares a los aplicados para los activos materiales. <br /><br /><span style=\"color: #000000;\">4.1</span><span style=\"color: #000000;\">.1</span>. Gastos de investigación y desarrollo<br /><br />Los gastos de investigación y desarrollo únicamente se reconocen como activo intangible si se cumplen todas las condiciones  indicadas a continuación:<br /><span style=\"color: #000000;\">Si</span> están específicamente individualizados por proyectos y su coste está claramente establecido, de manera que se puede distribuir en el tiempo.<br /><br />Si hay motivos fundados del éxito técnico y de la rentabilidad económico-comercial del proyecto o proyectos de que se trate. <br /><br />Estos activos se amortizan linealmente a lo largo de sus vidas útiles que se han considerado que son <span style=\"color: #000000;\">5</span> años. En el caso de que existieran dudas razonables sobre el éxito técnico o la rentabilidad económico-comercial del proyecto, los importes registrados en el activo se imputarían directamente a pérdidas del ejercicio. <br /><br /><span style=\"color: #000000;\">4.1</span><span style=\"color: #000000;\">.2</span>. Propiedad industrial<br /><br />Se han contabilizado en este concepto los gastos de desarrollo capitalizados ya que se ha obtenido la correspondiente patente o similar. Se ha incluido el coste de registro y formalización de la propiedad industrial <span style=\"color: #000000;\">&#40;</span>y los importes por la adquisición a terceros de los derechos correspondientes<span style=\"color: #000000;\">&#41;</span>.<br />Estos activos se amortizan linealmente a lo largo de sus vidas útiles que son <span style=\"color: #000000;\">5</span> años.<br /><br /><span style=\"color: #000000;\">4.1</span><span style=\"color: #000000;\">.3</span>. Aplicaciones informáticas.<br /><br />Los costes de adquisición y desarrollo incurridos en relación con los sistemas informáticos básicos en la gestión de la Sociedad se registran con cargo al epígrafe “Aplicaciones informáticas” del balance de situación. <br /><br />Los costes de mantenimiento de los sistemas informáticos se registran con cargo a la cuenta de resultados del ejercicio en que se incurren.<br /><br />La amortización de las aplicaciones informáticas se realiza linealmente en un periodo de tres o cuatro años. <br /><br /><span style=\"color: #000000;\">4.2</span>. Inmovilizado material.<br /><br />Los bienes comprendidos en el inmovilizado material se valorarán por el precio de adquisición o el coste de producción. <br /><br />Con posterioridad a su reconocimiento inicial, los elementos del inmovilizado material se valorarán por su precio de adquisición o coste de producción menos la amortización acumulada y, en su caso, se tendrá en cuenta el importe acumulado de las correcciones valorativas por deterioro del valor reconocidas <span style=\"color: #000000;\">&#40;</span>siguiendo las mismas pautas que para los inmovilizados intangibles<span style=\"color: #000000;\">&#41;</span>.<br /><br />Capitalización de intereses y diferencias de cambio, amortización y dotación de provisiones, costos de ampliación, modernización y mejoras adquiridas o efectuadas por la sociedad, actualizaciones amparadas en una Ley de actualización de valores.<br />Se aplica el criterio de amortizar de forma lineal a todo lo largo de la vida útil del producto. Si se producen correcciones valorativas por deterioro de carácter reversible se realiza el correspondiente apunte a las cuentas de deterioro y se reconocerán como un gasto o un ingreso, respectivamente, en la cuenta de pérdidas y ganancias. <br /><br />Los intereses devengados hasta el momento de la puesta en marcha de inmovilizado material, de haberse producido, se incluyen en el coste de este, registrándose como gastos financieros los devengados con posterioridad.<br /><br />Las posibles diferencias de cambio positivas en adquisiciones a crédito se contabilizan en la Cuenta <span style=\"color: #000000;\">768</span> <span style=\"color: #000000;\">&#40;</span>Diferencias positivas de cambio<span style=\"color: #000000;\">&#41;</span>.<br /><br />Las posibles diferencias de cambio negativas en adquisiciones a crédito, se registran directamente en la Cuenta <span style=\"color: #000000;\">668</span> <span style=\"color: #000000;\">&#40;</span>Diferencias Negativas de Cambio<span style=\"color: #000000;\">&#41;</span>.<br /><br />Los costes de ampliación, modernización y mejoras del inmovilizado se agregan al mismo. Los adquiridos al exterior se contabilizan por su precio de adquisición, por su valor venal.<br /><br />Los costos del inmovilizado producidos en el seno de la propia empresa, por su coste de producción, compuesto por las materias primas valoradas a su precio de adquisición, los costes directos de las ampliaciones, modernización y mejoras, así como el porcentaje proporcional de los costes y gastos indirectos.<br /><br />Las Actualizaciones de valores practicadas al amparo de la LEY en el ejercicio, no existen, en el Balance.<br /><br />Las pérdidas de valor experimentadas por los elementos del inmovilizado material es corregida mediante las cuentas de Amortizaciones. Se dota anualmente en función de los años de vida útil según método lineal.<br /><br />Si por alguna circunstancia, se observa una baja importante en el valor del bien a coste histórico y el valor de mercado en el momento de cierre del ejercicio se aplicará el correspondiente Deterioro.<br /><br />ELEMENTO DE INMOVILIZADO MATERIAL   Años de vida útil estimada<br />Construcciones  <span style=\"color: #000000;\">25</span><br />Instalaciones técnicas y maquinaria    <span style=\"color: #000000;\">10</span><br />Utillaje y herramientas <span style=\"color: #000000;\">5</span><br />Otras instalaciones <span style=\"color: #000000;\">10</span><br />Mobiliario y enseres    <span style=\"color: #000000;\">10</span><br />Equipos informáticos   <span style=\"color: #000000;\">4</span><br />Elementos de transporte <span style=\"color: #000000;\">6</span><br />Otro inmovilizado material  <span style=\"color: #000000;\">10</span><br /><br /><span style=\"color: #000000;\">4.3</span> Arrendamientos financieros de terrenos y edificios<br /><br />Los activos materiales adquiridos en régimen de arrendamiento financiero se registran en la categoría de activo a que corresponde el bien arrendado, amortizándose en su vida útil prevista siguiendo el mismo método que para los activos en propiedad. <br /><br />Los arrendamientos conjuntos de terreno y edificio se clasificarán como operativos o financieros con los mismos criterios que los arrendamientos de otro tipo de activo.<br /><br />Los arrendamientos se clasifican como arrendamientos financieros siempre que las condiciones de los mismos transfieran sustancialmente los riesgos y ventajas derivados de la propiedad al arrendatario. Los demás arrendamientos se clasifican como arrendamientos operativos. <br /><br />La política de amortización de los activos en régimen de arrendamiento financiero es similar a la aplicada a las inmovilizaciones materiales propias. <br /><br />Como normalmente el terreno tiene una vida económica indefinida, en un arrendamiento financiero conjunto, los componentes de terreno y edificio se consideran de forma separada, clasificándose el correspondiente al terreno como un arrendamiento operativo, salvo que se espere que el arrendatario adquiera la propiedad al <span style=\"color: #00C800;\">final</span> del periodo de arrendamiento.<br /><br />A estos efectos, los pagos mínimos por el arrendamiento se distribuyen entre el terrero y el edificio en proporción a los valores razonables relativos que representan los derechos de arrendamiento de ambos componentes, a menos que tal distribución no sea fiable, en cuyo caso todo el arrendamiento se clasificará como financiero, salvo que resulte evidente que es operativo.<br /><br />Si no existe la certeza razonable de que el arrendatario acabará obteniendo el título de propiedad al finalizar el contrato de arrendamiento, el activo se amortiza en el periodo más corto entre la vida útil estimada y la duración del contrato de arrendamiento. <br /><br />Los intereses derivados de la financiación de inmovilizado mediante arrendamiento financiero se imputan a los resultados del ejercicio de acuerdo con el criterio del interés efectivo, en función de la amortización de la deuda.  <br /><br /><span style=\"color: #000000;\">4.4</span>. Permutas.<br /><br />Durante el ejercicio no se ha producido ninguna permuta. <br /><br />Durante el ejercicio se ha producido una permuta que, por sus características, se ha calificado de comercial, procediéndose a la contabilización del resultado generado ya que era posible obtener de forma fiable el valor razonable del elemento entregado / recibido.  Las circunstancias que han llevado a calificar la permuta como comercial son las siguientes:<br /><span style=\"color: #000000;\">Existe</span> una diferencia entre la configuración <span style=\"color: #000000;\">&#40;</span>riesgo, calendario e importe<span style=\"color: #000000;\">&#41;</span> de los flujos de efectivo del inmovilizado recibido y la configuración de los flujos de efectivo del activo entregado. <br /><br />Se ha producido una variación en el valor actual de los flujos de efectivo después de impuestos de las actividades de la empresa afectadas por la permuta. <br />Además, las diferencias surgidas son significativas al compararlas con el valor razonable de los activos intercambiados. <br /><br />Durante el ejercicio se ha producido una permuta que, por sus características, se ha calificado de no comercial. El inmovilizado material recibido se ha valorado por el valor contable del bien entregado más las contrapartidas monetarias que se han entregado a cambio, teniendo en cuenta que el límite seria el valor razonable del inmovilizado recibido, cuando éste fuese menor. <br /><br /><span style=\"color: #000000;\">4.5</span>. Instrumentos financieros.<br /><br />Las diferentes categorías de activos financieros son las siguientes:<br /><br /><span style=\"color: #000000;\">4.5</span><span style=\"color: #000000;\">.1</span>. Préstamos y partidas a cobrar.<br /><br />En esta categoría se han incluido los activos que se han originado en la venta de bienes y prestación de servicios por operaciones de tráfico de la empresa. También se han incluido aquellos activos financieros que no se han originado en las operaciones de tráfico de la empresa y que no siendo instrumentos de patrimonio ni derivados, presentan unos cobros de cuantía determinada o determinable.  <br /><br />Estos activos financieros se han valorado por su valor razonable que no es otra cosa que el precio de la transacción, es decir, el valor razonable de la contraprestación más todos los costes que le han sido directamente atribuibles. <br /><br />Posteriormente, estos activos se han valorado por su coste amortizado, imputando en la cuenta de pérdidas y ganancias los intereses devengados, aplicando el método del tipo de interés efectivo.<br /><br />Por coste amortizado se entiende el coste de adquisición de un activo o pasivo financiero menos los reembolsos de principal y corregido, en más o menos, según sea el caso, por la parte imputada sistemáticamente a resultados de la diferencia entre el coste inicial y el correspondiente valor de reembolso al vencimiento. En el caso de los activos financieros, el coste amortizado incluye, además las correcciones a su valor motivadas por el deterioro que hayan experimentado. <br /><br />El tipo de interés efectivo es el tipo de actualización que iguala exactamente el valor de un instrumento financiero a la totalidad de sus flujos de efectivo estimados por todos los conceptos a lo largo de su vida remanente, en su cálculo se incluirán las comisiones financieras que se carguen por adelantado en la concesión de financiación. <br /><br />Los créditos por operaciones comerciales con vencimiento no superior a un año y que no tienen un tipo de interés contractual, así como los anticipos y créditos al personal, los dividendos a cobrar y los desembolsos exigidos sobre instrumentos de patrimonio, cuyo importe se espera recibir en el corto plazo, se valoran por su valor nominal cuando el efecto de no actualizar los flujos de efectivo no es significativo.<br />Los créditos con vencimiento no superior a un año que, de acuerdo con lo dispuesto en el apartado anterior, se valoren inicialmente por su valor nominal, continuarán valorándose por dicho importe, salvo que se hubieran deteriorado<br /><br />Los depósitos y fianzas se reconocen por el importe desembolsado para hacer frente a los compromisos contractuales.<br /><br />Se reconocen en el resultado del periodo las dotaciones y retrocesiones de provisiones por deterioro del valor de los activos financieros por diferencia entre el valor en libros y el valor actual de los flujos de efectivo recuperables. <br /><br /><span style=\"color: #000000;\">4.5</span><span style=\"color: #000000;\">.2</span>. Inversiones mantenidas hasta su vencimiento <br /><br />Activos financieros no derivados cuyos cobros son fijos o determinables, que se negocian en un mercado activo y con vencimiento fijo en los que la sociedad tiene la intención y capacidad de conservar hasta su finalización. Tras su reconocimiento inicial por su valor razonable, se han valorado también a su coste amortizado.<br /><br /><span style=\"color: #000000;\">4.5</span><span style=\"color: #000000;\">.3</span>. Activos financieros registrados a valor razonable con cambios en resultados<br /><br />En esta categoría se han incluido los activos financieros híbridos, es decir, aquellos que combinan un contrato principal no derivado y un derivado financiero y otros activos financieros que la empresa ha considerado conveniente incluir en esta categoría en el momento de su reconocimiento inicial. <br /><br />Se han valorado inicialmente por su valor razonable. Los costes de transacción que han sido directamente atribuibles se han registrado en la cuenta de resultados. También se han registrado en la cuenta de resultados las variaciones que se hayan producido en el valor razonable. <br /><br /><span style=\"color: #000000;\">4.5</span><span style=\"color: #000000;\">.4</span>. Activos financieros disponibles para la venta<br /><br />En esta categoría se han incluido los valores representativos de deuda e instrumentos de patrimonio de otras empresas que no se han incluido en ninguna otra categoría.<br /> <br />Se ha valorado inicialmente por su valor razonable y se han incluido en su valoración inicial el importe de los derechos preferentes de suscripción y similares, que se han adquirido. <br /><br />Posteriormente estos activos financieros se valoran por su valor razonable, <span style=\"color: #0000ff;\">sin</span> deducir los costes de transacción en los que deben incurrir para su enajenación. <br /><br />Los cambios que se produzcan en el valor razonable se registran directamente en el patrimonio neto, hasta que el activo financiero cause baja del balance o se deteriore, momento en que el importe así reconocido, se imputará a la cuenta de pérdidas y ganancias.<br /><br /><span style=\"color: #000000;\">4.5</span><span style=\"color: #000000;\">.5</span>. Derivados de cobertura<br /><br />Dentro de esta categoría se han incluido los activos financieros que han sido designados para cubrir un riesgo específico que puede tener impacto en la cuenta de resultados por las variaciones en el valor razonable o en los flujos de efectivo de las partidas cubiertas. <br />Estos activos se han valorado y registrado de acuerdo con su naturaleza. <br /><br /><span style=\"color: #000000;\">4.5</span><span style=\"color: #000000;\">.6</span>. Correcciones valorativas por deterioro<br /><br />Al cierre del ejercicio, se han efectuado las correcciones valorativas necesarias por la existencia de evidencia objetiva de que el valor en libros de una inversión no es recuperable.  <br />El importe de dicha corrección es la diferencia entre el valor en libros del activo financiero y el importe recuperable. Se entiende por importe recuperable como el mayor importe entre su valor razonable menos los costes de venta y el valor actual de los flujos de efectivo futuros derivados de la inversión.<br /><br />Las correcciones valorativas por deterioro, y en su caso, su reversión se han registrado como un gasto o un ingreso respectivamente en la cuenta de pérdidas y ganancias. La reversión tiene el límite del valor en libros del activo financiero.<br /><br />En particular, al <span style=\"color: #00C800;\">final</span> del ejercicio se comprueba la existencia de evidencia objetiva de que el valor de un crédito  <span style=\"color: #000000;\">&#40;</span>o de un grupo de créditos con similares características de riesgo valorados colectivamente<span style=\"color: #000000;\">&#41;</span> se ha deteriorado como consecuencia de uno o más eventos que han ocurrido después de su reconocimiento inicial y que han ocasionado una reducción o un retraso en los flujos de efectivo que se habían estimado recibir en el futuro y que puede estar motivado por insolvencia del deudor. <br /><br />La pérdida por deterioro será la diferencia entre su valor en libros y el valor actual de los flujos de efectivo futuros que se han estimado que se van a recibir, descontándolos al tipo de interés efectivo calculado en el momento de su reconocimiento inicial.<br /><br />Las diferentes categorías de pasivos financieros son las siguientes:<br /><br /><span style=\"color: #000000;\">4.5</span><span style=\"color: #000000;\">.7</span>. Débitos y partidas a pagar<br /><br />En esta categoría se han incluido los pasivos financieros que se han originado en la compra de bienes y servicios por operaciones de tráfico de la empresa y aquellos que no siendo instrumentos derivados, no tienen un origen comercial. <br /><br />Inicialmente, estos pasivos financieros se han registrado por su valor razonable que  es el precio de la transacción más todos aquellos costes que han sido directamente atribuibles. <br />Posteriormente, se han valorado por su coste amortizado. Los intereses devengados se han contabilizado en la cuenta de pérdidas y ganancias, aplicando el método del tipo de interés efectivo. <br /><br />Los débitos por operaciones comerciales con vencimiento no superior a un año y que no tienen un tipo de interés contractual, así como los desembolsos exigidos por terceros sobre participaciones, cuyo pago se espera que sea en el corto plazo, se han valorado por su valor nominal. <br /><br />Los débitos con vencimiento no superior a un año que, de acuerdo con lo dispuesto en el apartado anterior, se valoren inicialmente por su valor nominal, continuarán valorándose por dicho importe.<br /><br />Los préstamos y descubiertos bancarios que devengan intereses se registran por el importe recibido, neto de costes directos de emisión. Los gastos financieros, incluidas las primas pagaderas en la liquidación o el reembolso y los costes directos de emisión, se contabilizan según el criterio del devengo en la cuenta de resultados utilizando el método del interés efectivo y se añaden al importe en libros del instrumento en la medida en que no se liquidan en el periodo en que se devengan. <br /><br />Los préstamos se clasifican como corrientes a no ser que la Sociedad tenga el derecho incondicional para aplazar la cancelación del pasivo durante, al menos, los doce meses siguientes  a la fecha del balance.<br /><br />Los acreedores comerciales no devengan explícitamente intereses y se registran por su valor nominal. <br /><br /><span style=\"color: #000000;\">4.5</span><span style=\"color: #000000;\">.8</span>. Pasivos a valor razonable con cambios en la cuenta de resultados<br /><br />En esta categoría se han incluido los pasivos financieros híbridos, es decir, aquellos que combinan un contrato principal no derivado y un derivado financiero y otros pasivos financieros que la empresa ha considerado conveniente incluir dentro de esta categoría en el momento de su reconocimiento inicial. <br /><br />Se han valorado inicialmente por su valor razonable que es el precio de la transacción. Los costes de transacción que ha sido directamente atribuibles se han registrados en la cuenta de resultados. También se han imputado a la cuenta de resultados las variaciones que se hayan producido en el valor razonable. <br /><br /><span style=\"color: #000000;\">4.5</span><span style=\"color: #000000;\">.9</span>. Criterios que se han llevado si se ha dado de baja algún activo o pasivo financiero. <br /><br />Los criterios empleados para dar de baja un activo financiero son que haya expirado o se hayan cedido los derechos contractuales sobre los flujos de efectivo del activo financiero siendo necesario que se hayan transferido de manera substancial los riesgos y beneficios inherentes a su propiedad. <br /><br />Una vez se ha dado de baja el activo, la ganancia o pérdida surgida de esta operación formará parte del resultado del ejercicio en el que ésta se haya producido.  <br /><br />En el caso de los pasivos financieros la empresa los da de baja cuando la  obligación se ha extinguido. También se da de baja un pasivo financiero cuando se produce un intercambio de instrumentos financieros con condiciones substancialmente diferentes. <br /><br />La diferencia entre el valor en libros del pasivo financiero y la contraprestación pagada  incluidos los costes  de transacción atribuibles, se recoge en la cuenta de pérdidas y ganancias.   <br />Inversiones en empresas del grupo, multigrupo y asociadas<br /><br />Este tipo de inversiones se han valorado inicialmente por su coste, es decir, el valor razonable de la contraprestación entregada más los costes de transacción que le han sido directamente atribuibles. Posteriormente estas inversiones se han valorado por su coste menos el importe acumulado de las correcciones valorativas por deterioro. <br /><br /><span style=\"color: #000000;\">4.5</span><span style=\"color: #000000;\">.10</span>. Criterios para la determinación de los ingresos y gastos procedentes de las distintas categorías de instrumentos financieros.<br /><br />Los intereses y dividendos de activos financieros devengados con posterioridad  al momento de la adquisición se han reconocido como ingresos en la cuenta de pérdidas y ganancias. Para el reconocimiento de los intereses se ha utilizado el método del tipo de interés efectivo. Los dividendos se reconocen cuando se declare el derecho del socio a recibirlo.   <br /><br /><span style=\"color: #000000;\">4.5</span><span style=\"color: #000000;\">.11</span>. Instrumentos de patrimonio propio en poder de la empresa <br /><br />Cuando la empresa ha realizado alguna transacción con sus propios instrumentos de patrimonio, se ha registrado el importe de estos instrumentos en el patrimonio neto. Los gastos derivados de estas transacciones, incluidos los gastos de emisión de estos instrumentos, se han registrado directamente contra el patrimonio neto como menores reservas. <br /><br />Cuando se ha desistido de una operación de esta naturaleza, los gastos derivados de la misma se han reconocido en la cuenta de pérdidas y ganancias.<br /><br /><span style=\"color: #000000;\">4.6</span>. Existencias<br /><br />Las existencias están valoradas al precio de adquisición o al coste de producción. Si necesitan un periodo de tiempo superior al año para estar en condiciones de ser vendidas, se incluye en dicho valor, los gastos financieros oportunos. <br /><br />Los impuestos indirectos que gravan las existencias sólo se incluirán en el precio de adquisición o coste de producción cuando no sean recuperables directamente de la Hacienda Pública.<br /><br />El precio de adquisición incluye el importe facturado por el vendedor después de deducir cualquier descuento, rebaja en el precio u otras partidas similares así como los intereses incorporados al nominal de los débitos, y se añadirán todos los gastos adicionales que se produzcan hasta que los bienes se hallen ubicados para su venta, tales como transportes, aranceles de aduanas, seguros y otros directamente atribuibles a la adquisición de las existencias.<br /><br />El coste de producción se determina añadiendo al precio de adquisición de las materias primas y otras materias consumibles, y los costes directamente imputables al producto. También se añade la parte que razonablemente corresponda de los costes indirectamente imputables a los productos de que se trate, en la medida en que tales costes correspondan al periodo de fabricación, elaboración o construcción, en los que se haya incurrido al ubicarlos para su venta y se basen en el nivel de utilización de la capacidad <span style=\"color: #0000ff;\">normal</span> de trabajo de los medios de producción.<br /><br />La sociedad cuando se trate de asignar valor a bienes concretos que forman parte de un inventario de bienes intercambiables entre sí, adoptará con carácter general el método del precio medio o coste medio ponderado.<br /><br />Cuando el valor neto realizable sea inferior a su precio de adquisición o a su coste de producción, se efectuarán las correspondientes correcciones valorativas. <br /><br />El valor neto realizable representa la estimación del precio de venta menos todos los costes estimados de terminación y los costes que serán incurridos en los procesos de comercialización, venta y distribución.<br /><br />La Sociedad realiza una evaluación del valor neto realizable de las existencias al <span style=\"color: #00C800;\">final</span> del ejercicio, dotando la oportuna pérdida cuando las mismas se encuentran sobrevaloradas.<br /><br />Cuando las circunstancias que previamente causaron la rebaja hayan dejado de existir o cuando exista clara evidencia de incremento en el valor neto realizable debido a un cambio en las circunstancias económicas, se procede a revertir el importe de dicha rebaja. <br /><br /><span style=\"color: #000000;\">4.7</span>. Transacciones en moneda extranjera<br /><br />Las transacciones en moneda extranjera se registran en el momento de su reconocimiento inicial, utilizando la moneda funcional, aplicando el tipo de cambio vigente en la fecha de la transacción entre la moneda funcional y la extranjera. <br /><br />En la fecha de cada balance de situación, los activos y pasivos  monetarios en moneda extranjera, se convierten según los tipos vigentes en la fecha de cierre. Las partidas no monetarias en moneda extranjera medidas en términos de coste histórico se convierten al tipo de cambio de la fecha de la transacción. <br /><br />Las diferencias de cambio de las partidas monetarias que surjan tanto al liquidarlas, como al convertirlas al tipo de cambio de cierre, se reconocen en los resultados del ejercicio, excepto aquellas que formen parte de la inversión de un negocio en el extranjero, que se reconocen directamente en el patrimonio neto de impuestos hasta el momento de su enajenación. <br /><br />En algunas ocasiones, con el fin de cubrir su exposición a ciertos riesgos de cambio, la Sociedad formaliza contratos y opciones a plazo de moneda extranjera. <br /><br />Los ajustes del fondo de comercio y el valor razonable generados en la adquisición de una entidad con moneda funcional distinta del euro, se consideran activos y pasivos de dicha entidad y se convierten según el tipo vigente al cierre. <br /><br /><span style=\"color: #000000;\">4.8</span>. Impuesto sobre beneficios<br /><br />El gasto por impuesto sobre beneficios representa la suma del gasto por impuesto sobre beneficios del ejercicio así como por el efecto de las variaciones de los activos y pasivos por impuestos anticipados, diferidos y créditos fiscales. <br /><br />El gasto por impuesto sobre beneficios del ejercicio se calcula mediante la suma del impuesto corriente que resulta de la aplicación del tipo de gravamen sobre la base imponible del ejercicio, después de aplicar las deducciones que fiscalmente son admisibles, más la variación de los activos y pasivos por impuestos anticipados / diferidos y créditos fiscales, tanto por bases imponibles negativas como por deducciones.<br /><br />Los activos y pasivos por impuestos diferidos incluyen las diferencias temporarias que se identifican como aquellos importes que se prevén pagaderos o recuperables por las diferencias entre los importes en libros de los activos y pasivos y su valor fiscal, así como las bases imponibles negativas pendientes de compensación  y los créditos por deducciones fiscales no aplicadas fiscalmente. Dichos importes se registran aplicando a la diferencia temporaria o crédito que corresponda el tipo de gravamen al que se espera recuperarlos o liquidarlos.<br /><br />Se reconocen pasivos por impuestos diferidos para todas las diferencias temporarias imponibles a menos que éstas hubiesen surgido del reconocimiento inicial de una combinación de negocios, o del reconocimiento inicial de otros activos y pasivos en una operación que no afecta ni al resultado fiscal ni al resultado contable. Por su parte, los activos por impuestos diferidos, identificados con diferencias temporarias sólo se reconocen en el caso de que se considere probable que la Sociedad va a tener en el futuro suficientes ganancias fiscales contra las que poder hacerlos efectivos. El resto de activos por impuestos diferidos <span style=\"color: #000000;\">&#40;</span>bases imponibles negativas y deducciones pendientes de compensar<span style=\"color: #000000;\">&#41;</span> solamente se reconocen en el caso de que se considere probable que la Sociedad vaya a tener en el futuro suficientes ganancias fiscales contra las que poder hacerlos efectivos. <br /><br />Con ocasión de cada cierre contable, se revisan los impuestos diferidos registrados <span style=\"color: #000000;\">&#40;</span>tanto activos como pasivos<span style=\"color: #000000;\">&#41;</span> con objeto de comprobar que se mantienen vigentes, efectuándose las oportunas correcciones a los mismos de acuerdo con los resultados de los análisis realizados. <br /><br />Los activos y pasivos por impuesto diferido se valoran según los tipos de gravamen esperados en el momento de su reversión, según la normativa que esté vigente o aprobada y pendiente de publicación en la fecha de cierre del ejercicio, y de acuerdo con la forma en que racionalmente se prevea recuperar o pagar el activo o el pasivo.<br /><br /><span style=\"color: #000000;\">4.9</span>. Ingresos y gastos <br /><br />Los ingresos y gastos se imputan en función del principio del devengo, es decir, cuando se produce la corriente real de bienes y servicios que los mismos representan, con independencia del momento en que se produzca la corriente monetaria o financiera derivada de ellos. <br />Concretamente, los ingresos se calculan al valor razonable de la contraprestación a recibir y representan los importes a cobrar por los bienes entregados y los servicios prestados en el marco ordinario de la actividad, deducidos los descuentos e impuestos.<br /><br />Los ingresos por intereses se devengan siguiendo un criterio financiero temporal, en función del principal pendiente de pago, el plazo transcurrido y el tipo de interés efectivo aplicable. <br /><br />Los servicios prestados a terceros se reconocen al formalizar la aceptación por parte del cliente. Los que en el momento de la emisión de estados financieros se encuentran realizados pero no aceptados se valoran al menor valor entre los costes incurridos y la estimación de aceptación. <br />Cuando el resultado de una transacción que implique la prestación de servicios no puede ser estimado de forma fiable, se reconocen ingresos, sólo en la cuantía en que los gastos reconocidos se consideran recuperables.<br /><br /><span style=\"color: #000000;\">4.10</span>. Provisiones y contingencias<br /><br />Las cuentas anuales de la Sociedad recogen todas las provisiones significativas en las que es mayor la probabilidad de que se tenga que atender la obligación.<br /><br />Las provisiones se reconocen únicamente en base a hechos presentes o pasados que generen obligaciones futuras. Se cuantifican teniendo en consideración la mejor información disponible sobre las consecuencias del suceso que las motivan y son reestimadas con ocasión de cada cierre contable. Se utilizan para afrontar las obligaciones específicas para las que fueron originalmente reconocidas. Se procede a su reversión total o parcial, cuando dichas obligaciones dejan de existir o disminuyen.<br /><br /><span style=\"color: #000000;\">4.12</span>. Gastos de personal<br /><br />Los gastos de personal incluyen todos los haberes y las obligaciones de orden social obligatorias o voluntarias devengadas en cada momento, reconociendo las obligaciones por pagas extras, vacaciones o haberes variables y sus gastos asociados.<br /><br />Algunos empleados perciben como parte de su remuneración una aportación a un plan de pensiones de aportación definida gestionada de forma externalizada y se reconoce como gasto de personal; al no existir ninguna remuneración a largo plazo en forma de prestación definida gestionada internamente no se reconoce pasivo alguno en este concepto. <br /><br /><span style=\"color: #000000;\">4.13</span>. Subvenciones, donaciones y legados<br /><br />Las subvenciones, donaciones y legados no reintegrables se contabilizan como ingresos directamente imputados al patrimonio neto y se reconocen en la cuenta de pérdidas y ganancias como ingresos sobre una base sistemática y racional de forma correlacionada con los gastos derivados del gasto o inversión objeto de la subvención. <br /><br />La imputación a resultados de las subvenciones, donaciones y legados que tengan el carácter de no reintegrables se efectuará atendiendo a su finalidad.<br /><br />Las subvenciones, donaciones y legados no reintegrables concedidas para asegurar una rentabilidad mínima o compensar los déficit de explotación: <span style=\"color: #000000;\">se</span> imputan como ingresos del ejercicio en el que han sido concedidas, salvo si se destinan a financiar déficit de explotación de ejercicios futuros, en cuyo caso se imputarán en dichos ejercicios.<br /><br />Las subvenciones, donaciones y legados no reintegrables concedidas para financiar gastos específicos: <span style=\"color: #000000;\">se</span> imputan como ingresos en el mismo ejercicio en el que se devenguen los gastos que estén financiando.<br /><br />Las subvenciones, donaciones y legados no reintegrables concedidas para adquirir Activos del inmovilizado intangible, material e inversiones inmobiliarias: <span style=\"color: #000000;\">se</span> imputarán como ingresos del ejercicio en proporción a la dotación a la amortización efectuada en ese periodo para los citados elementos o, en su caso, cuando se produzca su enajenación, corrección valorativa por deterioro o baja en balance.<br /><br />Las subvenciones, donaciones y legados no reintegrables concedidas para Cancelación de deudas: <span style=\"color: #000000;\">se</span> imputarán como ingresos del ejercicio en que se produzca dicha cancelación, salvo cuando se otorguen en relación con una financiación específica, en cuyo caso la imputación se realizará en función del elemento financiado.<br /><br />Las subvenciones, donaciones y legados que tengan carácter de reintegrables se registran como pasivos de la empresa hasta que adquieren la condición de no reintegrables.  <br /><br /><span style=\"color: #000000;\">4.14</span>. Combinaciones de negocio<br /><br />La sociedad durante el ejercicio no ha realizado operaciones de esta naturaleza.<br /><br /><span style=\"color: #000000;\">4.15</span>. Negocios conjuntos<br /><br />No existe ninguna actividad económica controlada conjuntamente con otra persona física o jurídica. <br /><br /><span style=\"color: #000000;\">4.16</span>. Transacciones entre partes vinculadas<br /><br />Las operaciones comerciales o financieras con partes vinculadas se realizan a precio de mercado. No se reconoce beneficio ni pérdida alguna en las operaciones internas.<br /><br />En las operaciones en negocios conjuntos se reconocen los gastos incurridos por la sociedad, que se minoran en su caso si existe un derecho contractual para repercutirlo a otros contrapartes del negocio conjunto. No se reconoce beneficio alguno en operaciones internas del negocio conjunto. <br /> </div>[/code:1b56b016]\n\nUn saludo\n\nCarlos", "time": "11:51", "topic": "Campo MEMO", "username": "colthop" } ]
Campo MEMO
[ { "date": "2011-05-23", "forum": "FiveWin para Harbour/xHarbour", "text": "Me confundes un poco... \nzCampoMe001 = CampoMe001\nva002 = campome001\n\n@ 95*ProporV, 35*ProPorH GET gDlg001 VAR zCampoMe001 MEMO OF oDlgwVen PIXEL COLOR escri02, fondo02 FONT oFont SIZE 640*ProPorH, 1050*ProPorV NOBORDER\n@ 10*ProporV, 35*ProPorH GET vDlg151 VAR va002 MEMO OF oDlgwBro PIXEL COLOR escri02, fondo02 FONT oFont SIZE 640*ProPorH, 570*ProPorV NOBORDER\n\ny asi lo reemplazo:\nreplace CampoMe001 with zCampoMe001\nreplace CampoMe001 with va002\n\nEstás usando 2 variables para editar el mismo campo? Ambos se llaman CampoMe0001. Salvo por eso, no veo nada extraño.", "time": "11:30", "topic": "Campo MEMO", "username": "Carlos Mora" } ]
Campo MEMO
[ { "date": "2011-05-23", "forum": "FiveWin para Harbour/xHarbour", "text": "Hola Carlos:\n\nlo que dije es que hay dos sitios pordende se solicita un campo memo y he puesto las dos. Las tres primeras lineas de los apartados es una y las otras tres otra.\n\nzCampoMe001 = CampoMe001\n@ 95*ProporV, 35*ProPorH GET gDlg001 VAR zCampoMe001 MEMO OF oDlgwVen PIXEL COLOR escri02, fondo02 FONT oFont SIZE 640*ProPorH, 1050*ProPorV NOBORDER\nreplace CampoMe001 with zCampoMe001\n\n\nva002 = campome001\n@ 10*ProporV, 35*ProPorH GET vDlg151 VAR va002 MEMO OF oDlgwBro PIXEL COLOR escri02, fondo02 FONT oFont SIZE 640*ProPorH, 570*ProPorV NOBORDER\nreplace CampoMe001 with va002\n\nEn cualquiera de las dos, el texto se queda en:\n\n\"4.13. Subvenciones, donaciones y legados\n\nLas subvenciones, donaciones y legados \"\n\nUn saludo\n\ncarlos", "time": "14:57", "topic": "Campo MEMO", "username": "colthop" } ]
Campo MEMO
[ { "date": "2011-05-25", "forum": "FiveWin para Harbour/xHarbour", "text": "Hola.\n\nCuidado con los campos memo. Si los utilizas para escribir, modificar o borrar su contenido... VAS A PERDER DATOS.\n\nCampos memo=PROBLEMAS.\n\nTrata de utilizar ficheros de texto (si te es posible) no te tendras problemas.\n\nO Utilizar tablas con un campo caracter del maxímo tamaño que te permita el RDD y luego internamente los controlas....\n\nSuerte.", "time": "11:16", "topic": "Campo MEMO", "username": "jMelgar" } ]
Campo MEMO
[ { "date": "2011-05-25", "forum": "FiveWin para Harbour/xHarbour", "text": "Hola jMelgar:\n\nComo se utilizarian archivos de textoy como puedosaber el maximode caracteres que permite el RRD.\n\nUn saludo\n\narlos", "time": "18:38", "topic": "Campo MEMO", "username": "colthop" } ]
Campo MEMO
[ { "date": "2011-05-26", "forum": "FiveWin para Harbour/xHarbour", "text": "Hola Carlos\n\nYo tambien uso los famoso campos memo, ahora utilizo .CDX y el archivo de los campos memo son .FPT\n\nLo trabajo asi :\n\n// para editarlo\n\nmNotas := FItems->NOTAS // cargo la variable a partir de un campo MEMO de mi tabla\n\n..............\n..............\n\nDEFINE DIALOG oDlg NAME \"ITEM1\" TITLE cArticulo\n\n REDEFINE GET oNotas VAR mNotas MEMO ID 4002 OF oDlg COLORS nRgb(0,0,255),nRgb(128,255,255)\n\n oNotas:bGotFocus = { || oNotas:SetSel( 0, 0 ),;\n oNotas:Goto( oNotas:GetLineCount() ),;\n __Keyboard( Chr( VK_END ) ) }\n\nACTIVATE DIALOG oDlg CENTERED\n\n// para grabarlo\n\nIF lGraba\n\n IF FItems->(Rlock())\n.........\n.........\n FItems->NOTAS :=mNotas\n\n ENDIF\n\nENDIF\n\n// Para Imprimirlo/Mostrarlo\n\nIF !EMPTY(cTexto) // en cTexto tengo el campo MEMO\n\n nLines := MlCount(cTexto,50) // armo segmentos de 50 caracteres\n\n FOR nFor := 1 TO nLines // en nLines queda el numero de segmentos de 50 caracteres\n\n cLine := OemToAnsi(MemoLine(cTexto, 50, nFor))\n\n @ nRow,nCol SAY cLine FONT nFont3 // muestro todos lo segmentos\n\n NEXT\n\nENDIF\n\na mi parecer los de tipo .FPT son mas ventajosos por que ocupan menos espacio y albergan mas informacion, es decir no hay limite para el texto que deseas guardar.\n\n// Espero haberte ayudado\n\nSaludos", "time": "04:44", "topic": "Campo MEMO", "username": "LuisPonce" } ]
Campo MEMO
[ { "date": "2011-05-26", "forum": "FiveWin para Harbour/xHarbour", "text": "Gracias Luis, seguro que me sirve todo lo que me has puesto, que es lo que estaba buscando.\n\nUn saludo\n\nCarlos", "time": "06:14", "topic": "Campo MEMO", "username": "colthop" } ]
Campo MEMO
[ { "date": "2011-05-26", "forum": "FiveWin para Harbour/xHarbour", "text": "Hola, de nuevo.\n\nNo se el tamaño máximo de los memos con CDX, ya que como te digo, los memo se corrompen MUY FACILMENTE y si la informacion que vas a guardar es importante (mas si se trata de la de un cliente) puedes tener problemas serios. Yo me libré por los pelos de dichos problemas. Suerte!, es lo unico que puedo desearte si decides continuar con la idea usar memos.\n\nLa opción más sencilla es que crees un campo que contenga un contador y ese mismo contador sea el nombre del archivo txt que contenga la informacion que quieres guardar en los memo. Yo, como te dije, me vi obligado a cambiar los memo y utilizo documentos Word y se acabaron los problemas Y ADEMÁS al utilizar word (u otro) dispones de todas las posibilidades que te ofrece un procesador de textos, cosa que con memo es MUY laborioso y NUNCA conseguiras el mismo aspecto.", "time": "10:56", "topic": "Campo MEMO", "username": "jMelgar" } ]
Campo MEMO
[ { "date": "2011-05-26", "forum": "FiveWin para Harbour/xHarbour", "text": "[quote=\"colthop\":1zyx8uf5]\nEn cualquiera de las dos, el texto se queda en:\n\n\"4.13. Subvenciones, donaciones y legados\n\nLas subvenciones, donaciones y legados \"\n[/quote:1zyx8uf5]\nEs como si el campo fuese un char y no un memo... no?\nPodrias rechequear la estructura? o pásame por privado algo del código que yo pueda probar...", "time": "15:52", "topic": "Campo MEMO", "username": "Carlos Mora" } ]
Campo MEMO
[ { "date": "2011-05-27", "forum": "FiveWin para Harbour/xHarbour", "text": "Hola Carlos:\n\nSi puedo pasarte algo del codigopor privado pero no se tu privado el mio es <!-- e --><a href=\"mailto:carlos@colthop.es\">carlos@colthop.es</a><!-- e -->.\n\nNo obstante pongo aqui lo principal :\n\nAsi se crea la ventana donde esta alojado:\n\n[code=fw:2v1tib61]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><span style=\"color: #0000ff;\">SELECT</span> <span style=\"color: #000000;\">47</span><br />use &ZB1 SHARED<br />OrdSetFocus <span style=\"color: #000000;\">&#40;</span>zb1a<span style=\"color: #000000;\">&#41;</span><br />seek zejer + str<span style=\"color: #000000;\">&#40;</span>opci00,<span style=\"color: #000000;\">1</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span> + zNom + padl<span style=\"color: #000000;\">&#40;</span>alltrim<span style=\"color: #000000;\">&#40;</span>str<span style=\"color: #000000;\">&#40;</span>zNum01,<span style=\"color: #000000;\">2</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>,<span style=\"color: #000000;\">2</span>,<span style=\"color: #ff0000;\">\"0\"</span><span style=\"color: #000000;\">&#41;</span> + padl<span style=\"color: #000000;\">&#40;</span>alltrim<span style=\"color: #000000;\">&#40;</span>str<span style=\"color: #000000;\">&#40;</span>zNum02,<span style=\"color: #000000;\">2</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>,<span style=\"color: #000000;\">2</span>,<span style=\"color: #ff0000;\">\"0\"</span><span style=\"color: #000000;\">&#41;</span><br /><span style=\"color: #00C800;\">if</span> eof<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br />  NuevDeCu<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br /><span style=\"color: #00C800;\">endif</span><br />oDlgwBro:<span style=\"color: #000000;\">Hide</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br />oDlgwBro:<span style=\"color: #000000;\">Destroy</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br />re   = <span style=\"color: #000000;\">0</span><br />zImpMan1 = <span style=\"color: #000000;\">0</span><br />zImpMan4 = <span style=\"color: #000000;\">12</span><br />zAnc = <span style=\"color: #000000;\">590</span><br />zLar = <span style=\"color: #000000;\">810</span><br />zVer = int<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">600</span>  - <span style=\"color: #000000;\">590</span><span style=\"color: #000000;\">&#41;</span>/<span style=\"color: #000000;\">2</span><span style=\"color: #000000;\">&#41;</span><br />zHor = int<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">1024</span> - <span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">810</span>*zProPorH<span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>/<span style=\"color: #000000;\">2</span><span style=\"color: #000000;\">&#41;</span><br /><span style=\"color: #0000ff;\">DEFINE</span> <span style=\"color: #0000ff;\">WINDOW</span> oDlgwVen <span style=\"color: #0000ff;\">MDICHILD</span> <span style=\"color: #0000ff;\">OF</span> oVentPrinc <span style=\"color: #0000ff;\">PIXEL</span> <span style=\"color: #0000ff;\">FROM</span> zVer*ProPorV,zHor*ProPorH <span style=\"color: #0000ff;\">TO</span> <span style=\"color: #000000;\">&#40;</span>zVer+zAnc<span style=\"color: #000000;\">&#41;</span>*ProPorV,<span style=\"color: #000000;\">&#40;</span>zHor+zLar<span style=\"color: #000000;\">&#41;</span>*ProPorH COLORS escri01, fondo01 <span style=\"color: #0000ff;\">STYLE</span>  nOr<span style=\"color: #000000;\">&#40;</span>WS_DLGFRAME, WS_VSCROLL<span style=\"color: #000000;\">&#41;</span><br />  <span style=\"color: #0000ff;\">DEFINE</span> SCROLLBAR oDlgwVen:<span style=\"color: #000000;\">oVScroll</span> <span style=\"color: #0000ff;\">VERTICAL</span> <span style=\"color: #0000ff;\">OF</span> oDlgwVen<br />  oDlgwVen:<span style=\"color: #000000;\">bKeyDown</span>    = <span style=\"color: #000000;\">&#123;</span> | nKey                    | ImprDeCu <span style=\"color: #000000;\">&#40;</span> nKey       <span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#125;</span><br />  oDlgwVen:<span style=\"color: #000000;\">bMouseWheel</span> = <span style=\"color: #000000;\">&#123;</span> | nKey,nDelta,nXPos,nYPos | RatoDeCu <span style=\"color: #000000;\">&#40;</span> nKey,nDelta,nXPos,nYPos <span style=\"color: #000000;\">&#41;</span> <span style=\"color: #000000;\">&#125;</span><br />  pintdecu<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br /><span style=\"color: #0000ff;\">ACTIVATE</span> <span style=\"color: #0000ff;\">WINDOW</span> oDlgwVen <span style=\"color: #0000ff;\">NORMAL</span> <span style=\"color: #0000ff;\">ON</span> <span style=\"color: #0000ff;\">INIT</span> IMPOSTASCROLL9<span style=\"color: #000000;\">&#40;</span>oDlgwVen,.T.<span style=\"color: #000000;\">&#41;</span> <span style=\"color: #0000ff;\">VALID</span> <span style=\"color: #000000;\">&#40;</span><span style=\"color: #00C800;\">if</span> <span style=\"color: #000000;\">&#40;</span>GetKeyState <span style=\"color: #000000;\">&#40;</span>VK_ESCAPE<span style=\"color: #000000;\">&#41;</span>, .F.,oDlgwBus:<span style=\"color: #000000;\">End</span><span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span><br /><span style=\"color: #00C800;\">RETURN</span> <span style=\"color: #000000;\">&#40;</span><span style=\"color: #00C800;\">NIL</span><span style=\"color: #000000;\">&#41;</span></div>[/code:2v1tib61]\n\nAsi se carga lavariable (al final del todo\n[code=fw:2v1tib61]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\">procedure TomaDeCu<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br /><span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />  <span style=\"color: #00C800;\">case</span> opci00 = <span style=\"color: #000000;\">1</span><br />    <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">1</span><br />        zNum04 = <span style=\"color: #000000;\">0</span><br />        zNum05 = <span style=\"color: #000000;\">20</span><br />        zNum06 = <span style=\"color: #000000;\">27</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">2</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">32</span><br />            zNum06 = <span style=\"color: #000000;\">64</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">30</span><br />            zNum06 = <span style=\"color: #000000;\">60</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">3</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">12</span><br />            zNum06 = <span style=\"color: #000000;\">24</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">4</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">30</span><br />            zNum06 = <span style=\"color: #000000;\">60</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">5</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">34</span><br />            zNum06 = <span style=\"color: #000000;\">68</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">3</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">32</span><br />            zNum06 = <span style=\"color: #000000;\">64</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">30</span><br />            zNum06 = <span style=\"color: #000000;\">60</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">4</span><br />        zNum04 = <span style=\"color: #000000;\">0</span><br />        zNum05 = <span style=\"color: #000000;\">23</span><br />        zNum06 = <span style=\"color: #000000;\">46</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">5</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">87</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">87</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">3</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">87</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">4</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">87</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">5</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">29</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">6</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">28</span><br />            zNum06 = <span style=\"color: #000000;\">56</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">20</span><br />            zNum06 = <span style=\"color: #000000;\">40</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">3</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">29</span><br />            zNum06 = <span style=\"color: #000000;\">58</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">7</span><br />        zNum04 = <span style=\"color: #000000;\">0</span><br />        zNum05 = <span style=\"color: #000000;\">2</span><br />        zNum06 = <span style=\"color: #000000;\">0</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">8</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">50</span><br />            zNum05 = <span style=\"color: #000000;\">26</span><br />            zNum06 = <span style=\"color: #000000;\">129</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">62</span><br />            zNum05 = <span style=\"color: #000000;\">31</span><br />            zNum06 = <span style=\"color: #000000;\">155</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">3</span><br />            zNum04 = <span style=\"color: #000000;\">33</span><br />            zNum05 = <span style=\"color: #000000;\">33</span><br />            zNum06 = <span style=\"color: #000000;\">0</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">4</span><br />            zNum04 = <span style=\"color: #000000;\">33</span><br />            zNum05 = <span style=\"color: #000000;\">66</span><br />            zNum06 = <span style=\"color: #000000;\">33</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">5</span><br />            zNum04 = <span style=\"color: #000000;\">33</span><br />            zNum05 = <span style=\"color: #000000;\">66</span><br />            zNum06 = <span style=\"color: #000000;\">33</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">6</span><br />            zNum04 = <span style=\"color: #000000;\">33</span><br />            zNum05 = <span style=\"color: #000000;\">33</span><br />            zNum06 = <span style=\"color: #000000;\">33</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">7</span><br />            zNum04 = <span style=\"color: #000000;\">33</span><br />            zNum05 = <span style=\"color: #000000;\">33</span><br />            zNum06 = <span style=\"color: #000000;\">33</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">8</span><br />            zNum04 = <span style=\"color: #000000;\">66</span><br />            zNum05 = <span style=\"color: #000000;\">33</span><br />            zNum06 = <span style=\"color: #000000;\">66</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">9</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">33</span><br />            zNum06 = <span style=\"color: #000000;\">0</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">9</span><br />        zNum04 = <span style=\"color: #000000;\">1</span><br />        zNum05 = <span style=\"color: #000000;\">36</span><br />        zNum06 = <span style=\"color: #000000;\">0</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">10</span><br />        zNum04 = <span style=\"color: #000000;\">0</span><br />        zNum05 = <span style=\"color: #000000;\">15</span><br />        zNum06 = <span style=\"color: #000000;\">0</span><br />    <span style=\"color: #00C800;\">endcase</span><br />  <span style=\"color: #00C800;\">case</span> opci00 = <span style=\"color: #000000;\">2</span><br />    <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">1</span><br />        zNum04 = <span style=\"color: #000000;\">0</span><br />        zNum05 = <span style=\"color: #000000;\">20</span><br />        zNum06 = <span style=\"color: #000000;\">27</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">2</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">22</span><br />            zNum06 = <span style=\"color: #000000;\">44</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">26</span><br />            zNum06 = <span style=\"color: #000000;\">52</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">3</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">16</span><br />            zNum06 = <span style=\"color: #000000;\">32</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">3</span><br />        zNum04 = <span style=\"color: #000000;\">0</span><br />        zNum05 = <span style=\"color: #000000;\">29</span><br />        zNum06 = <span style=\"color: #000000;\">58</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">4</span><br />        zNum04 = <span style=\"color: #000000;\">0</span><br />        zNum05 = <span style=\"color: #000000;\">19</span><br />        zNum06 = <span style=\"color: #000000;\">38</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">5</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">63</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">63</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">3</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">63</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">4</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">63</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">5</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">21</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">6</span><br />        zNum04 = <span style=\"color: #000000;\">0</span><br />        zNum05 = <span style=\"color: #000000;\">2</span><br />        zNum06 = <span style=\"color: #000000;\">0</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">7</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">50</span><br />            zNum05 = <span style=\"color: #000000;\">26</span><br />            zNum06 = <span style=\"color: #000000;\">129</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">62</span><br />            zNum05 = <span style=\"color: #000000;\">31</span><br />            zNum06 = <span style=\"color: #000000;\">155</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">3</span><br />            zNum04 = <span style=\"color: #000000;\">33</span><br />            zNum05 = <span style=\"color: #000000;\">33</span><br />            zNum06 = <span style=\"color: #000000;\">0</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">4</span><br />            zNum04 = <span style=\"color: #000000;\">33</span><br />            zNum05 = <span style=\"color: #000000;\">66</span><br />            zNum06 = <span style=\"color: #000000;\">33</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">5</span><br />            zNum04 = <span style=\"color: #000000;\">33</span><br />            zNum05 = <span style=\"color: #000000;\">66</span><br />            zNum06 = <span style=\"color: #000000;\">33</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">6</span><br />            zNum04 = <span style=\"color: #000000;\">33</span><br />            zNum05 = <span style=\"color: #000000;\">33</span><br />            zNum06 = <span style=\"color: #000000;\">33</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">7</span><br />            zNum04 = <span style=\"color: #000000;\">33</span><br />            zNum05 = <span style=\"color: #000000;\">33</span><br />            zNum06 = <span style=\"color: #000000;\">33</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">8</span><br />            zNum04 = <span style=\"color: #000000;\">66</span><br />            zNum05 = <span style=\"color: #000000;\">33</span><br />            zNum06 = <span style=\"color: #000000;\">66</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">9</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">33</span><br />            zNum06 = <span style=\"color: #000000;\">0</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">8</span><br />        zNum04 = <span style=\"color: #000000;\">1</span><br />        zNum05 = <span style=\"color: #000000;\">36</span><br />        zNum06 = <span style=\"color: #000000;\">0</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">9</span><br />        zNum04 = <span style=\"color: #000000;\">0</span><br />        zNum05 = <span style=\"color: #000000;\">15</span><br />        zNum06 = <span style=\"color: #000000;\">0</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">10</span><br />        zNum04 = <span style=\"color: #000000;\">0</span><br />        zNum05 = <span style=\"color: #000000;\">0</span><br />        zNum06 = <span style=\"color: #000000;\">0</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">11</span><br />        zNum04 = <span style=\"color: #000000;\">0</span><br />        zNum05 = <span style=\"color: #000000;\">0</span><br />        zNum06 = <span style=\"color: #000000;\">0</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">12</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">0</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">26</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">13</span><br />        zNum04 = <span style=\"color: #000000;\">0</span><br />        zNum05 = <span style=\"color: #000000;\">0</span><br />        zNum06 = <span style=\"color: #000000;\">0</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">14</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">0</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">90</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">15</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">0</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">108</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">3</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">118</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">16</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">0</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">138</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">17</span><br />        zNum04 = <span style=\"color: #000000;\">0</span><br />        zNum05 = <span style=\"color: #000000;\">0</span><br />        zNum06 = <span style=\"color: #000000;\">0</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">18</span><br />        zNum04 = <span style=\"color: #000000;\">0</span><br />        zNum05 = <span style=\"color: #000000;\">0</span><br />        zNum06 = <span style=\"color: #000000;\">0</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">19</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">0</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">62</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">20</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">0</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">147</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">3</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">147</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">4</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">203</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">5</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">203</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">21</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">0</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">64</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">22</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">0</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">32</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">3</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">14</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">23</span><br />        zNum04 = <span style=\"color: #000000;\">0</span><br />        zNum05 = <span style=\"color: #000000;\">0</span><br />        zNum06 = <span style=\"color: #000000;\">14</span><br />    <span style=\"color: #00C800;\">endcase</span><br />  <span style=\"color: #00C800;\">case</span> opci00 = <span style=\"color: #000000;\">3</span><br />    <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">1</span><br />        zNum04 = <span style=\"color: #000000;\">0</span><br />        zNum05 = <span style=\"color: #000000;\">20</span><br />        zNum06 = <span style=\"color: #000000;\">27</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">2</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">21</span><br />            zNum06 = <span style=\"color: #000000;\">42</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">25</span><br />            zNum06 = <span style=\"color: #000000;\">50</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">3</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">15</span><br />            zNum06 = <span style=\"color: #000000;\">30</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">3</span><br />        zNum04 = <span style=\"color: #000000;\">0</span><br />        zNum05 = <span style=\"color: #000000;\">28</span><br />        zNum06 = <span style=\"color: #000000;\">56</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">4</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">81</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">81</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">3</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">81</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">4</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">81</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">5</span><br />        zNum04 = <span style=\"color: #000000;\">0</span><br />        zNum05 = <span style=\"color: #000000;\">2</span><br />        zNum06 = <span style=\"color: #000000;\">0</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">6</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">50</span><br />            zNum05 = <span style=\"color: #000000;\">26</span><br />            zNum06 = <span style=\"color: #000000;\">129</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">62</span><br />            zNum05 = <span style=\"color: #000000;\">31</span><br />            zNum06 = <span style=\"color: #000000;\">155</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">3</span><br />            zNum04 = <span style=\"color: #000000;\">33</span><br />            zNum05 = <span style=\"color: #000000;\">33</span><br />            zNum06 = <span style=\"color: #000000;\">0</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">4</span><br />            zNum04 = <span style=\"color: #000000;\">33</span><br />            zNum05 = <span style=\"color: #000000;\">66</span><br />            zNum06 = <span style=\"color: #000000;\">33</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">5</span><br />            zNum04 = <span style=\"color: #000000;\">33</span><br />            zNum05 = <span style=\"color: #000000;\">66</span><br />            zNum06 = <span style=\"color: #000000;\">33</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">6</span><br />            zNum04 = <span style=\"color: #000000;\">33</span><br />            zNum05 = <span style=\"color: #000000;\">33</span><br />            zNum06 = <span style=\"color: #000000;\">33</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">7</span><br />            zNum04 = <span style=\"color: #000000;\">33</span><br />            zNum05 = <span style=\"color: #000000;\">33</span><br />            zNum06 = <span style=\"color: #000000;\">33</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">8</span><br />            zNum04 = <span style=\"color: #000000;\">66</span><br />            zNum05 = <span style=\"color: #000000;\">33</span><br />            zNum06 = <span style=\"color: #000000;\">66</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">9</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">33</span><br />            zNum06 = <span style=\"color: #000000;\">0</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">7</span><br />        zNum04 = <span style=\"color: #000000;\">1</span><br />        zNum05 = <span style=\"color: #000000;\">36</span><br />        zNum06 = <span style=\"color: #000000;\">0</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">8</span><br />        zNum04 = <span style=\"color: #000000;\">0</span><br />        zNum05 = <span style=\"color: #000000;\">15</span><br />        zNum06 = <span style=\"color: #000000;\">0</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">9</span><br />        zNum04 = <span style=\"color: #000000;\">0</span><br />        zNum05 = <span style=\"color: #000000;\">0</span><br />        zNum06 = <span style=\"color: #000000;\">0</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">10</span><br />        zNum04 = <span style=\"color: #000000;\">0</span><br />        zNum05 = <span style=\"color: #000000;\">0</span><br />        zNum06 = <span style=\"color: #000000;\">0</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">11</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">0</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">26</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">12</span><br />        zNum04 = <span style=\"color: #000000;\">0</span><br />        zNum05 = <span style=\"color: #000000;\">0</span><br />        zNum06 = <span style=\"color: #000000;\">0</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">13</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">0</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">90</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">14</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">0</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">108</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">3</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">118</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">15</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">0</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">138</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">16</span><br />        zNum04 = <span style=\"color: #000000;\">0</span><br />        zNum05 = <span style=\"color: #000000;\">0</span><br />        zNum06 = <span style=\"color: #000000;\">0</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">17</span><br />        zNum04 = <span style=\"color: #000000;\">0</span><br />        zNum05 = <span style=\"color: #000000;\">0</span><br />        zNum06 = <span style=\"color: #000000;\">0</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">18</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">0</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">62</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">19</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">0</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">147</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">3</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">147</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">4</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">203</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">5</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">203</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">20</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">0</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">64</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">21</span><br />        <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">1</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">0</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">2</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">32</span><br />          <span style=\"color: #00C800;\">case</span> zNum02 = <span style=\"color: #000000;\">3</span><br />            zNum04 = <span style=\"color: #000000;\">0</span><br />            zNum05 = <span style=\"color: #000000;\">0</span><br />            zNum06 = <span style=\"color: #000000;\">14</span><br />        <span style=\"color: #00C800;\">endcase</span><br />      <span style=\"color: #00C800;\">case</span> zNum01 = <span style=\"color: #000000;\">22</span><br />        zNum04 = <span style=\"color: #000000;\">0</span><br />        zNum05 = <span style=\"color: #000000;\">0</span><br />        zNum06 = <span style=\"color: #000000;\">14</span><br />    <span style=\"color: #00C800;\">endcase</span><br /><span style=\"color: #00C800;\">endcase</span><br /><span style=\"color: #0000ff;\">SELECT</span> <span style=\"color: #000000;\">47</span><br /><span style=\"color: #00C800;\">if</span> re = <span style=\"color: #000000;\">0</span><br />  seek zejer + str<span style=\"color: #000000;\">&#40;</span>opci00,<span style=\"color: #000000;\">1</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span> + zNom + padl<span style=\"color: #000000;\">&#40;</span>alltrim<span style=\"color: #000000;\">&#40;</span>str<span style=\"color: #000000;\">&#40;</span>zNum01,<span style=\"color: #000000;\">2</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>,<span style=\"color: #000000;\">2</span>,<span style=\"color: #ff0000;\">\"0\"</span><span style=\"color: #000000;\">&#41;</span> + padl<span style=\"color: #000000;\">&#40;</span>alltrim<span style=\"color: #000000;\">&#40;</span>str<span style=\"color: #000000;\">&#40;</span>zNum02,<span style=\"color: #000000;\">2</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><span style=\"color: #000000;\">&#41;</span>,<span style=\"color: #000000;\">2</span>,<span style=\"color: #ff0000;\">\"0\"</span><span style=\"color: #000000;\">&#41;</span><br /><span style=\"color: #00C800;\">else</span><br />  go re<br /><span style=\"color: #00C800;\">endif</span><br />a = <span style=\"color: #000000;\">1</span><br /><span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">while</span> .T.<br />  <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />    <span style=\"color: #00C800;\">case</span> a > <span style=\"color: #000000;\">99</span><br />      zVari1 = <span style=\"color: #ff0000;\">\"zCampoFe\"</span> + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">3</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari2 = <span style=\"color: #ff0000;\">\"zCampoTe\"</span> + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">3</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari3 = <span style=\"color: #ff0000;\">\"zCampoNu\"</span> + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">3</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari4 = <span style=\"color: #ff0000;\">\"CampoFe\"</span>  + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">3</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari5 = <span style=\"color: #ff0000;\">\"CampoTe\"</span>  + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">3</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari6 = <span style=\"color: #ff0000;\">\"CampoNu\"</span>  + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">3</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />    <span style=\"color: #00C800;\">case</span> a >  <span style=\"color: #000000;\">9</span><br />      zVari1 = <span style=\"color: #ff0000;\">\"zCampoFe0\"</span> + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">2</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari2 = <span style=\"color: #ff0000;\">\"zCampoTe0\"</span> + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">2</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari3 = <span style=\"color: #ff0000;\">\"zCampoNu0\"</span> + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">2</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari4 = <span style=\"color: #ff0000;\">\"CampoFe0\"</span>  + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">2</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari5 = <span style=\"color: #ff0000;\">\"CampoTe0\"</span>  + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">2</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari6 = <span style=\"color: #ff0000;\">\"CampoNu0\"</span>  + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">2</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />    <span style=\"color: #00C800;\">otherwise</span><br />      zVari1 = <span style=\"color: #ff0000;\">\"zCampoFe00\"</span> + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">1</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari2 = <span style=\"color: #ff0000;\">\"zCampoTe00\"</span> + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">1</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari3 = <span style=\"color: #ff0000;\">\"zCampoNu00\"</span> + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">1</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari4 = <span style=\"color: #ff0000;\">\"CampoFe00\"</span>  + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">1</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari5 = <span style=\"color: #ff0000;\">\"CampoTe00\"</span>  + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">1</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari6 = <span style=\"color: #ff0000;\">\"CampoNu00\"</span>  + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">1</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />  <span style=\"color: #00C800;\">endcase</span><br />  <span style=\"color: #00C800;\">if</span> a <= zNum04<br />    &zVari1 = &zVari4<br />  <span style=\"color: #00C800;\">endif</span><br />  <span style=\"color: #00C800;\">if</span> a <= zNum05<br />    &zVari2 = &zVari5<br />  <span style=\"color: #00C800;\">endif</span><br />  <span style=\"color: #00C800;\">if</span> a <= zNum06<br />    &zVari3 = &zVari6<br />  <span style=\"color: #00C800;\">endif</span><br />  a = a + <span style=\"color: #000000;\">1</span><br />  <span style=\"color: #00C800;\">if</span> a = <span style=\"color: #000000;\">205</span><br />    exit<br />  <span style=\"color: #00C800;\">endif</span><br /><span style=\"color: #00C800;\">enddo</span><br /><span style=\"color: #00C800;\">if</span> zNum04 + zNum05 + zNum06 = <span style=\"color: #000000;\">0</span><br />  zCampoMe001 := CampoMe001<br /><span style=\"color: #00C800;\">endif</span><br /><span style=\"color: #00C800;\">RETURN</span> <span style=\"color: #000000;\">&#40;</span><span style=\"color: #00C800;\">NIL</span><span style=\"color: #000000;\">&#41;</span></div>[/code:2v1tib61]\n\nAsi se pide primero una imagen de fondo:\n\n[code=fw:2v1tib61]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\">zImpMan1 = <span style=\"color: #000000;\">0</span><br />oImg = CurDrive<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span> + <span style=\"color: #ff0000;\">\":<span style=\"color: #000000;\">\\\"</span> + CurDir() + \"</span>\\impranua\\<span style=\"color: #ff0000;\">\" + zNom + padl(alltrim(str(zNum01,2,0)),2,\"</span><span style=\"color: #000000;\">0</span><span style=\"color: #ff0000;\">\") + padl(alltrim(str(zNum02,2,0)),2,\"</span><span style=\"color: #000000;\">0</span><span style=\"color: #ff0000;\">\") + \"</span>.png<span style=\"color: #ff0000;\">\"<br />@( 5*ProporV)-(zImpMan1*30),  5*ProporH IMAGE tDlg001 FILE oImg                 OF oDlgwVen PIXEL SIZE 700*ProporH,1185*ProporV ADJUST<br />botodecu()<br />gDlg001:SetFocus()</span></div>[/code:2v1tib61]\n\nDespues se solicita el campò:\n\n[code=fw:2v1tib61]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\">procedure To15DeCu<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br />@<span style=\"color: #000000;\">8000</span>*ProporV,<span style=\"color: #000000;\">625</span>*ProporH <span style=\"color: #0000ff;\">SAY</span> vDlg001 <span style=\"color: #0000ff;\">VAR</span> <span style=\"color: #ff0000;\">\"\"</span>          <span style=\"color: #0000ff;\">OF</span> oDlgwVen <span style=\"color: #0000ff;\">PIXEL</span> <span style=\"color: #0000ff;\">COLOR</span> escri03, fondo03 <span style=\"color: #0000ff;\">FONT</span> oFont <span style=\"color: #0000ff;\">SIZE</span>   <span style=\"color: #000000;\">0</span>*ProporH,       <span style=\"color: #000000;\">0</span>*ProPorV<br />@  <span style=\"color: #000000;\">95</span>*ProporV, <span style=\"color: #000000;\">35</span>*ProPorH <span style=\"color: #0000ff;\">GET</span> gDlg001 <span style=\"color: #0000ff;\">VAR</span> zCampoMe001 MEMO <span style=\"color: #0000ff;\">OF</span> oDlgwVen <span style=\"color: #0000ff;\">PIXEL</span> <span style=\"color: #0000ff;\">COLOR</span> escri02, fondo02 <span style=\"color: #0000ff;\">FONT</span> oFont <span style=\"color: #0000ff;\">SIZE</span> <span style=\"color: #000000;\">640</span>*ProPorH,    <span style=\"color: #000000;\">1050</span>*ProPorV NOBORDER<br /><span style=\"color: #00C800;\">RETURN</span> <span style=\"color: #000000;\">&#40;</span><span style=\"color: #00C800;\">NIL</span><span style=\"color: #000000;\">&#41;</span></div>[/code:2v1tib61]\n\nAsi se graba (al final):\n\n[code=fw:2v1tib61]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\">procedure GrabDeCu<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br />bloqfila<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br />a = <span style=\"color: #000000;\">1</span><br /><span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">while</span> .T.<br />  <span style=\"color: #00C800;\">do</span> <span style=\"color: #00C800;\">case</span><br />    <span style=\"color: #00C800;\">case</span> a > <span style=\"color: #000000;\">99</span><br />      zVari1 = <span style=\"color: #ff0000;\">\"zCampoFe\"</span> + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">3</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari2 = <span style=\"color: #ff0000;\">\"zCampoTe\"</span> + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">3</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari3 = <span style=\"color: #ff0000;\">\"zCampoNu\"</span> + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">3</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari4 = <span style=\"color: #ff0000;\">\"CampoFe\"</span>  + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">3</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari5 = <span style=\"color: #ff0000;\">\"CampoTe\"</span>  + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">3</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari6 = <span style=\"color: #ff0000;\">\"CampoNu\"</span>  + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">3</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />    <span style=\"color: #00C800;\">case</span> a >  <span style=\"color: #000000;\">9</span><br />      zVari1 = <span style=\"color: #ff0000;\">\"zCampoFe0\"</span> + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">2</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari2 = <span style=\"color: #ff0000;\">\"zCampoTe0\"</span> + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">2</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari3 = <span style=\"color: #ff0000;\">\"zCampoNu0\"</span> + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">2</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari4 = <span style=\"color: #ff0000;\">\"CampoFe0\"</span>  + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">2</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari5 = <span style=\"color: #ff0000;\">\"CampoTe0\"</span>  + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">2</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari6 = <span style=\"color: #ff0000;\">\"CampoNu0\"</span>  + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">2</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />    <span style=\"color: #00C800;\">otherwise</span><br />      zVari1 = <span style=\"color: #ff0000;\">\"zCampoFe00\"</span> + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">1</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari2 = <span style=\"color: #ff0000;\">\"zCampoTe00\"</span> + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">1</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari3 = <span style=\"color: #ff0000;\">\"zCampoNu00\"</span> + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">1</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari4 = <span style=\"color: #ff0000;\">\"CampoFe00\"</span>  + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">1</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari5 = <span style=\"color: #ff0000;\">\"CampoTe00\"</span>  + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">1</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />      zVari6 = <span style=\"color: #ff0000;\">\"CampoNu00\"</span>  + str<span style=\"color: #000000;\">&#40;</span>a,<span style=\"color: #000000;\">1</span>,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />  <span style=\"color: #00C800;\">endcase</span><br />  <span style=\"color: #00C800;\">if</span> a <= zNum04<br />    replace &zVari4 with &zVari1<br />  <span style=\"color: #00C800;\">endif</span><br />  <span style=\"color: #00C800;\">if</span> a <= zNum05<br />    replace &zVari5 with &zVari2<br />  <span style=\"color: #00C800;\">endif</span><br />  <span style=\"color: #00C800;\">if</span> a <= zNum06<br />    replace &zVari6 with &zVari3<br />  <span style=\"color: #00C800;\">endif</span><br />  a = a + <span style=\"color: #000000;\">1</span><br />  <span style=\"color: #00C800;\">if</span> a = <span style=\"color: #000000;\">205</span><br />    exit<br />  <span style=\"color: #00C800;\">endif</span><br /><span style=\"color: #00C800;\">enddo</span><br /><span style=\"color: #00C800;\">if</span> zNum04 + zNum05 + zNum06 = <span style=\"color: #000000;\">0</span><br />*   replace CampoMe001 with zCampoMe001<br />  CampoMe001 := zCampoMe001<br /><span style=\"color: #00C800;\">endif</span><br /><span style=\"color: #00C800;\">if</span> zNum01 = <span style=\"color: #000000;\">1</span><br />  va110 = campote018<br />  va111 = campote019<br />  va112 = campote020<br />  va100 = campote001<br />  va101 = campote005<br />  va102 = space<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">20</span><span style=\"color: #000000;\">&#41;</span><br />  va103 = campote006<br />  va104 = campote007<br />  va105 = campote008<br /><span style=\"color: #00C800;\">endif</span><br />dbunlock<span style=\"color: #000000;\">&#40;</span><span style=\"color: #000000;\">&#41;</span><br /><span style=\"color: #00C800;\">RETURN</span> <span style=\"color: #000000;\">&#40;</span><span style=\"color: #00C800;\">NIL</span><span style=\"color: #000000;\">&#41;</span></div>[/code:2v1tib61]\n\nUn saludo\n\nCarlos", "time": "06:48", "topic": "Campo MEMO", "username": "colthop" } ]
Campo MEMO
[ { "date": "2012-08-15", "forum": "FiveWin para Harbour/xHarbour", "text": "Hola a todos\n\nTengo un campo memo en MySQL, y pues la verdad este campo memo guarda un archive de texto nitido con la misma estructura pero como puedo hacer para leer este campo memo y guardarlo con la misma estructura, lo que sucede es que al guardarlo en disco se corrompe la estructura.\n\nAtentamente\nJulio Ponce", "time": "00:19", "topic": "Campo Memo", "username": "jponce" } ]
Campo Memo
[ { "date": "2010-04-07", "forum": "FiveWin para Harbour/xHarbour", "text": "Por favor necesito ayuda, requiero imprimir un campo memo de mysql el tipo de campo es [b:2xv2r3ae]longtext,[/b:2xv2r3ae] \neste es el codigo que estouy manejando, en esot momentos estoy grabano y modificando bien usando TRichEdit(), el problema es como imprimo.\n\n\n cText := oDatos:Fields(\"documen\"):Value\n cText = MEMOREAD( cText )\n nLines := MlCount(cText,76)\n\n .. . ..\n\n FOR nFor := 1 TO nLines\n cLine := MemoLine(cText, 76, nFor)\n oPrn:CmSay( nRow,2, cLine, aoFont[6],,,,0)\n nRow+=0.5; nConta++\n NEXT", "time": "23:20", "topic": "Campo Memo en Mysql -- Ayuda", "username": "ruben Dario" } ]
Campo Memo en Mysql -- Ayuda
[ { "date": "2010-04-07", "forum": "FiveWin para Harbour/xHarbour", "text": "Prueba asi:\n\n[code=fw:xmtlbtzc]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><br />        nLines :=  MlCount<span style=\"color: #000000;\">&#40;</span>cText<span style=\"color: #000000;\">&#41;</span><br />        <span style=\"color: #00C800;\">FOR</span> nFor := <span style=\"color: #000000;\">1</span> <span style=\"color: #0000ff;\">TO</span> nLines<br />          cLine := MemoLine<span style=\"color: #000000;\">&#40;</span>cText, <span style=\"color: #000000;\">76</span>, nFor<span style=\"color: #000000;\">&#41;</span><br />          oPrn:<span style=\"color: #000000;\">CmSay</span><span style=\"color: #000000;\">&#40;</span> nRow,<span style=\"color: #000000;\">2</span>, cLine, aoFont<span style=\"color: #000000;\">&#91;</span><span style=\"color: #000000;\">6</span><span style=\"color: #000000;\">&#93;</span>,,,,<span style=\"color: #000000;\">0</span><span style=\"color: #000000;\">&#41;</span><br />          vRow := vRow + <span style=\"color: #000000;\">0.4</span>; nConta++<br />        <span style=\"color: #00C800;\">NEXT</span><br /> </div>[/code:xmtlbtzc]", "time": "23:34", "topic": "Campo Memo en Mysql -- Ayuda", "username": "Willi Quintana" } ]
Campo Memo en Mysql -- Ayuda