Either the input parameter (dlfn) shouldn't be const and therefore it's okay to call expand() (no non-const cast)
Or, when a CDfsLogicalFileName needs expanding it returns a new [expanded] instance instead of altering itself.

I suspect the latter is correct, but it's a bigger change that changes the semantics a bit, so go with the former for now, i.e. remove the dlfn const where expand() is possible.