Posts Tagged ‘C++’

Common Controls: Versions, Compatibility, WTL

Posted: 30th October 2011 by Roman in WTL
Tags: , , , ,

An application appears to be not working in Windows XP in a weird way: rebar control appeared to fail showing up. Where the application is expected to look much nicer with rebar control as a container for menu (implemented as command bar WTL control) and toolbar with buttons: A WTL sample project generated by a [...]

The minimalistic sample demonstrates support of [deprecated] Waveform Audio API for multiple playback streams. Depending on command line parameters, the application starts threads to open audio hardware using separate waveOutOpen call and stream one or more generated sine waves: 1,000 Hz sine wave as 22,050 Hz, Mono, 16-bit PCM (command line parameter “a”) 5,000 Hz [...]

GeneratePcmWavFile tool is generating PCM .WAV files with requested parameters, silent or with a sine wave data. The utility uses WavDest SDK Sample as a multiplexer, so it is expected to be available. It is possible to define the following audio data parameters: sampling frequency, number of samples per second, such as 44100 or 48000 [...]

The LoadCpu tool creates one or more threads to waste CPU cycles and emulate slower environment, such as for testing and troubleshooting. There has been a great deal of similar tools out there, and this one in particular is convenient/special as it takes process affinity mask as a parameter. That is, /a:NN defines affinity mask, [...]

ATLENSURE_SUCCEEDED double failure

Posted: 19th July 2011 by Roman in ATL, Source
Tags: , , , , ,

A colleague pointed out that code snippet in previous post is misusing ATL’s ATLENSURE_SUCCEEDED macro making it [possibly] evaluate its argument twice in case of failure, that is evaluating into failure HRESULT code. As it is defined like this: #define ATLENSURE_SUCCEEDED(hr) ATLENSURE_THROW(SUCCEEDED(hr), hr) It does things in a straightforward way, for a code line ATLENSURE_SUCCEEDED(pFilterGraph.CoCreateInstance(CLSID_FilterGraph)); [...]

An updated version of LogProcessExceptions utility is given an additional option to create minidump .DMP files for debugged process on user request. This is in particular useful in conjunction with flag choices (on the previous page of the wizard). Download links: Partial Visual C++ .NET 2010 source code: Trac, Subversion Binaries: Win32 – LogProcessExceptions.exe, x64 [...]

Recent IP Video Source class/module is not limited to use via registration as a video input/capture/source device. The filter is also registered as a regular filter and can be used programmatically in a regular way: CoCreateInstance, AddFilter etc. A C++ code snippet below shows how to import interface definition, create an instance of the filter, [...]