Inflation is also simply in the minds of the people using the currency. If everyone expects high inflation, and keeps raising their prices to match their expectation of inflation, then inflation will happen - the raising of prices will ensure that. And if you try to fix that by force, as you pointed out, the inflation accelerates even more, because it's now happening in a black market with even more waste.
The way they fixed inflation in Brazil was, it appears, by changing people's expectation of what should happen to currency. They had to get everyone to believe that the brazilian currency can be stable. The mechanism they used to do that was the cheap trick of creating an alternative currency and calling it "real". It may be a cheap trick, but from the look of it, it worked.