3D ordered macroporous multicomponent composite materials have been fabricated by electrochemical deposition of aniline on the inner surface of macroporous carbon; the maximum thickness of polyaniline (PANI) deposited is dependent on the concentration of the aniline as well as the dimension of the windows in the macroporous carbon