Sorry, no suggestions, but can I hope you're helping Felipe with his ChessFPC program?
If you are interested on working a bit on this, try to learn the engine protocols:
it's useless to discuss code without posting it.