Tag: C++

C++ #import and x64 builds

I already wrote earlier on 32/64-bit issues with Visual Studio. The problems are not frequent but when they happen they are pretty confusing. Here is another one today. C++ code is simple: #import “libid:59941706-0000-1111-2222-7EE5C88402D2” raw_interfaces_only no_namespace CComPtr<IObject> pObject; ATLENSURE_SUCCEEDED(pObject.CoCreateInstance(__uuidof(Object))); BYTE* pnData; ATLENSURE_SUCCEEDED(pObject->Method((ULONG_PTR) (BYTE*) pnData)); A COM method returns a pointer to data – pretty straightforward,…

Read the full article

Small correction for DirectShow BaseClasses CTransInPlaceFilter::Copy

False assertion failure in DirectShow BaseClasses transip.cpp, in CTransInPlaceFilter::Copy: ASSERT(lDestSize >= lSourceSize && lDestSize >= lDataLength); […] CopyMemory((PVOID) pDestBuffer, (PVOID) pSourceBuffer, lDataLength); The code asserts on “lDestSize >= lSourceSize” which is true in most cases, but it does not have or need to be true. The code below copies just lDataLength bytes and assertion on…

Read the full article

DirectShowSpy: Media Sample Traces

Overview DirectShow filters pass media samples (portions of data) through graphs and details of how the streaming happens exactly is important for debugging and troubleshooting DirectShow graphs and development. A developer needs clear understanding of parts of streaming process, importance of which increases with multiple streams, threads, parallelization, cut-off times, multiple graphs working simultaneously. Details…

Read the full article

Continuous realloc()

A colleague raised a question that realloc does better than free + malloc because allocated memory block is never being actually shrunk and reallocations to smaller size following by reallocations to larger (but still not larger than one of the previous) do not lead to heap locks and actual underlying heap memory block reallocations. While…

Read the full article