Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Removing MFC classes, and replacing with ANSI C++

Removing MFC classes, and replacing with ANSI C++

Scheduled Pinned Locked Moved C / C++ / MFC
c++csharpjsontutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Fu Manchu
    wrote on last edited by
    #1

    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..

    H 1 Reply Last reply
    0
    • F Fu Manchu

      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..

      H Offline
      H Offline
      Hanan888
      wrote on last edited by
      #2

      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 ?

      F 1 Reply Last reply
      0
      • H Hanan888

        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 ?

        F Offline
        F Offline
        Fu Manchu
        wrote on last edited by
        #3

        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++

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups