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. MFC:: CString & Serialize ::C++

MFC:: CString & Serialize ::C++

Scheduled Pinned Locked Moved C / C++ / MFC
c++learningasp-netgraphicsdesign
4 Posts 3 Posters 1 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.
  • V Offline
    V Offline
    valikac
    wrote on last edited by
    #1

    Hello. I am very familiar with C++ STL including the containers string and stringstream. When I learned of CString and other MFC data structure and mutator when I began learning MFC from Prosise's book (chapter 6). I am learning MFC so that I can design and implement Windows 32bit programming using C++. Ultimate, as far as textchar data is concerned, is it perferrable to use CString over C++ STL (string, vector, list, etc.)? Is it possible to have view draw character from a string object instead of a CString object? Lastly, does the default implementation for serialize work for C++ STL (string, vecto, list, etc.)? Does the STL container have to transfer data to a CString object first? One last issue involving NULL. Microsoft seems to like using NULL over '0', which Deitel & Deitel recommend (I highly recommend their C++ How to Program). I do not use NULL term at all in my programs. I use '0'. When using core C++ program I have been working on into MFC, is it a necessity to change from '0' to NULL, bool to BOOL, true to TRUE, etc. for *all* code (even non MFC)? Thanks, Kuphryn

    D V 2 Replies Last reply
    0
    • V valikac

      Hello. I am very familiar with C++ STL including the containers string and stringstream. When I learned of CString and other MFC data structure and mutator when I began learning MFC from Prosise's book (chapter 6). I am learning MFC so that I can design and implement Windows 32bit programming using C++. Ultimate, as far as textchar data is concerned, is it perferrable to use CString over C++ STL (string, vector, list, etc.)? Is it possible to have view draw character from a string object instead of a CString object? Lastly, does the default implementation for serialize work for C++ STL (string, vecto, list, etc.)? Does the STL container have to transfer data to a CString object first? One last issue involving NULL. Microsoft seems to like using NULL over '0', which Deitel & Deitel recommend (I highly recommend their C++ How to Program). I do not use NULL term at all in my programs. I use '0'. When using core C++ program I have been working on into MFC, is it a necessity to change from '0' to NULL, bool to BOOL, true to TRUE, etc. for *all* code (even non MFC)? Thanks, Kuphryn

      D Offline
      D Offline
      David Fedolfi
      wrote on last edited by
      #2

      kuphryn wrote: is it perferrable to use CString over C++ STL (string, vector, list, etc.) That depends on the rest of the application. If the only part of MFC you're using is going to be CString, then its a lot of extra ovehead to carry. kuphryn wrote: Is it possible to have view draw character from a string object instead of a CString object? Yes kuphryn wrote: Does the STL container have to transfer data to a CString object first? No, just the oppsoite. If you're using the stl implementation that ships with VC then there is an overloaded << operator that converts the string to a LPCSTR. If you're like me and using a different STL implementation, then you'll need to write your own or manually cast the CString to a LPCSTR kuphryn wrote: is it a necessity to change from '0' to NULL, bool to BOOL, true to TRUE from 0 to NULL - no, but bool and BOOL are different data types. They both mena the same, but a BOOL is just a typedef for an unsigned char (I think) The opinions expressed in this post are the sole property of the writer and therefore are not guaranteed to contain any accurate statements, nor are they guaranteed to be worth the time you spent reading it.

      M 1 Reply Last reply
      0
      • D David Fedolfi

        kuphryn wrote: is it perferrable to use CString over C++ STL (string, vector, list, etc.) That depends on the rest of the application. If the only part of MFC you're using is going to be CString, then its a lot of extra ovehead to carry. kuphryn wrote: Is it possible to have view draw character from a string object instead of a CString object? Yes kuphryn wrote: Does the STL container have to transfer data to a CString object first? No, just the oppsoite. If you're using the stl implementation that ships with VC then there is an overloaded << operator that converts the string to a LPCSTR. If you're like me and using a different STL implementation, then you'll need to write your own or manually cast the CString to a LPCSTR kuphryn wrote: is it a necessity to change from '0' to NULL, bool to BOOL, true to TRUE from 0 to NULL - no, but bool and BOOL are different data types. They both mena the same, but a BOOL is just a typedef for an unsigned char (I think) The opinions expressed in this post are the sole property of the writer and therefore are not guaranteed to contain any accurate statements, nor are they guaranteed to be worth the time you spent reading it.

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        David Fedolfi wrote: They both mena the same, but a BOOL is just a typedef for an unsigned char (I think) A BOOL is 4 bytes (in Win32 at least, dunno about Win64), while bool is 1 byte. --Mike-- Fetchez la vache! My really out-of-date homepage Sonork - 100.10414 AcidHelm Big fan of Alyson Hannigan and Jamie Salé.

        1 Reply Last reply
        0
        • V valikac

          Hello. I am very familiar with C++ STL including the containers string and stringstream. When I learned of CString and other MFC data structure and mutator when I began learning MFC from Prosise's book (chapter 6). I am learning MFC so that I can design and implement Windows 32bit programming using C++. Ultimate, as far as textchar data is concerned, is it perferrable to use CString over C++ STL (string, vector, list, etc.)? Is it possible to have view draw character from a string object instead of a CString object? Lastly, does the default implementation for serialize work for C++ STL (string, vecto, list, etc.)? Does the STL container have to transfer data to a CString object first? One last issue involving NULL. Microsoft seems to like using NULL over '0', which Deitel & Deitel recommend (I highly recommend their C++ How to Program). I do not use NULL term at all in my programs. I use '0'. When using core C++ program I have been working on into MFC, is it a necessity to change from '0' to NULL, bool to BOOL, true to TRUE, etc. for *all* code (even non MFC)? Thanks, Kuphryn

          V Offline
          V Offline
          valikac
          wrote on last edited by
          #4

          Okay. Thanks. Kuphryn

          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