Application of microcapsulation technology to the preparation of carbon foam