views:

70

answers:

2

C:\Program Files\Microsoft SDKs\Windows\v#.#\Samples\multimedia\directshow\baseclasses\wxdebug.gpp line 890:

/* If this fires you have a mixed DEBUG/RETAIL build */

ASSERT(!!szObjectName ^ !!wszObjectName);

What does it mean and how can I fix it?

If it matters: I've written a managed media player library that wraps DirectShow, and I'm using it in my WPF application.

A: 

The code looks like testing for mixed single/wide character build, since sz is a zero terminated string and wsz is a wide character zero terminated string, and the code basically tests if exactly one of them has a nonzero value. Maybe the comment is mixed up?

Try to find out if your build has partially UNICODE defined (or is built with wide character support, or something), and partially not.

OregonGhost
+1  A: 

This is not a unicode issue. The comment is correct: you are linking to a debug library, but you don't have DEBUG defined in your module.

There are two cases where the assert fires: where both are non-null, and and when both are null. Both non-null would indicate some unicode mixup, but this method is only ever called from within an #ifdef UNICODE with one of the params 0.

The object name parameter is normally passed to CBaseObject with the NAME() macro. This macro evalutes to NULL in release builds, and to the object name string in debug builds. CBaseObject will call the register function in debug builds.

Your constructor is compiling wxdebug.h with DEBUG not defined (so NAME() evaluates to NULL). But you are linking to a base class library which was built with DEBUG defined.

G

Geraint Davies
The actual problem was that I had `(LPCTSTR)NULL` where `NAME()` should have been.
CannibalSmith