Removing MFC classes, and replacing with ANSI C++
-
Hi all, I am trying to convert a API that's used in a MFC app, i want to convert this to .net. But i think it will make the job easier to strip out the MFC stuff and replace it with ANSI C++. I want to get it all working in a console app, so the MFC stuff is causing all the problems! Well i think? In the code i have..... CTime time; CTime datavalue; CTime is a MFC datatype, this i believe is different from the ctime method in the time.h. Is there a ANSI C++ class that will replace this? I thought about this a wrote a class like this.... class Ctime { public: time_t GetUTCTime(void); }; time_t Ctime::GetUTCTime() { time_t UTCTime; UTCTime = time(NULL); return UTCTime; } its missing a pointer, because i've spent so long in the .net world i've forget how to write C. I'm not sure if this will work anyway but at least i'll have the basic class replacement. thanks..
-
Hi all, I am trying to convert a API that's used in a MFC app, i want to convert this to .net. But i think it will make the job easier to strip out the MFC stuff and replace it with ANSI C++. I want to get it all working in a console app, so the MFC stuff is causing all the problems! Well i think? In the code i have..... CTime time; CTime datavalue; CTime is a MFC datatype, this i believe is different from the ctime method in the time.h. Is there a ANSI C++ class that will replace this? I thought about this a wrote a class like this.... class Ctime { public: time_t GetUTCTime(void); }; time_t Ctime::GetUTCTime() { time_t UTCTime; UTCTime = time(NULL); return UTCTime; } its missing a pointer, because i've spent so long in the .net world i've forget how to write C. I'm not sure if this will work anyway but at least i'll have the basic class replacement. thanks..
-
Fu Manchu wrote:
I am trying to convert a API that's used in a MFC app, i want to convert this to .net
You confused me if you're going.NET or not. If you do, you have all the time functions you'll need in .NET won't you ?
eh, you have int,double and string as well but you still need to make the existing code work, compile and build before you can convert to .Net just because .net as these function, isn't an answer you've missed the point! The existing code creates an instance of Ctime which is a MFC function, if i dont use this or an equivalent method, how can leverage .net time functions in C++