Okay, I found the solution by myself. It doesn't work the way I posted above.
Here the correct code, it may be useful for someone else:
std::string value;
CryptoPP::Weak1::MD4 hashmd4;
CryptoPP::StringSource (password, true,
new CryptoPP::HashFilter( hashmd4,
new CryptoPP::HexEncoder(
new CryptoPP::StringSink(value)
)
)
);