found the answer on this forum:

http://www.xtremedotnettalk.com/showthread.php?t=71907

This is easy to figure out but you can also combine the 2 lines:

String * fname = “Whatever String”;

char* ufname = ( char * ) ( void * ) Marshal::StringToHGlobalAnsi(fname);
// do your stuff with ufname here
Marshal::FreeHGlobal((int)ufname);

This is a very nice article, I found on for CString management. In fact it is an in depth , one place explanation for various unanswered String questions that you must have encountered in C++.

http://www.flounder.com/cstring.htm

1) http://support.microsoft.com/default.aspx?scid=kb;EN-US;311259

2) http://www.codeguru.com/forum/archive/index.php/t-372096.html

2) http://www.codeguru.com/Cpp/Cpp/cpp_managed/moving/article.php/c8031/

Dr Prabhaker Mateti is a distinguished professor from wright state university, and the link below on his home page was a great help to me while completing my thesis.

http://www.cs.wright.edu/~pmateti/GradStudents/advice.html

Found a nice link for people who want to use dll written in oldĀ C++ (.NET) (unmanaged)

http://www.brainbell.com/tutors/C_Sharp/Interoperating_with_Unmanaged_Code.htm

My friend suggested me the page below. I have to find some time to read the notes…

http://www.imsc.res.in/tcsweb/tcs.html