I had quite a few problems adding the htmlCode button to a fairly old copy of TinyMCE (I think around version 2.x).
All is resolved now and this is what I had to change:
Both changes are made in “editor_template.js” file, I also swopped the 2 files so that I could include and edit editor_template.js instead of the compressed “editor_template_src.js.
Using the advanced theme I added the following line near the top of the file:
Then in order for it to be available to the layout I added the ‘seperator’ and ‘code’ to the end of the layoutManager on about line 551.
Have any strange tinyMCE questions? Ask, perhaps I can help!