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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. VC 2005

VC 2005

Scheduled Pinned Locked Moved C / C++ / MFC
6 Posts 6 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.
  • A Offline
    A Offline
    ArielR
    wrote on last edited by
    #1

    I'm moving from VC6 to VC2005. This code.... class myAccessor { public: TCHAR m_EMPRESA[6]; SHORT m_TipoCpbte; BEGIN_COLUMN_MAP(CdboBajFactProvAccessor) COLUMN_ENTRY(1, m_EMPRESA) COLUMN_ENTRY(2, m_TipoCpbte) END_COLUMN_MAP() CString sEmpresa = "Esta Empresa"; strcpy( myAccessor.m_EMPRESA, sEmpresa ); myAccessor.m_TipoCpbte = 1; HRESULT hr = myAccessor.Insert(); I can't compile strcpy, invalid function. What function replace strcpy. Thanks

    T D M 3 Replies Last reply
    0
    • A ArielR

      I'm moving from VC6 to VC2005. This code.... class myAccessor { public: TCHAR m_EMPRESA[6]; SHORT m_TipoCpbte; BEGIN_COLUMN_MAP(CdboBajFactProvAccessor) COLUMN_ENTRY(1, m_EMPRESA) COLUMN_ENTRY(2, m_TipoCpbte) END_COLUMN_MAP() CString sEmpresa = "Esta Empresa"; strcpy( myAccessor.m_EMPRESA, sEmpresa ); myAccessor.m_TipoCpbte = 1; HRESULT hr = myAccessor.Insert(); I can't compile strcpy, invalid function. What function replace strcpy. Thanks

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      it's been deprecated (due to thread safety reasons), but never removed from the CRT (how could it?) ! if the compiler doesn't find it, you have a problem in your VS2005 installation


      [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

      C 1 Reply Last reply
      0
      • T toxcct

        it's been deprecated (due to thread safety reasons), but never removed from the CRT (how could it?) ! if the compiler doesn't find it, you have a problem in your VS2005 installation


        [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

        C Offline
        C Offline
        Cyrilix
        wrote on last edited by
        #3

        Interesting, I didn't know this. I thought it was deprecated for buffer overflow reasons.

        L 1 Reply Last reply
        0
        • C Cyrilix

          Interesting, I didn't know this. I thought it was deprecated for buffer overflow reasons.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Yes, it was because of the possibility of buffer overflow. -Randor

          1 Reply Last reply
          0
          • A ArielR

            I'm moving from VC6 to VC2005. This code.... class myAccessor { public: TCHAR m_EMPRESA[6]; SHORT m_TipoCpbte; BEGIN_COLUMN_MAP(CdboBajFactProvAccessor) COLUMN_ENTRY(1, m_EMPRESA) COLUMN_ENTRY(2, m_TipoCpbte) END_COLUMN_MAP() CString sEmpresa = "Esta Empresa"; strcpy( myAccessor.m_EMPRESA, sEmpresa ); myAccessor.m_TipoCpbte = 1; HRESULT hr = myAccessor.Insert(); I can't compile strcpy, invalid function. What function replace strcpy. Thanks

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            Even if strcpy() were available (it is, just not by default), you do realize that m_EMPRESA will only hold 6 characters, not the 13 that sEmpresa holds.


            "A good athlete is the result of a good and worthy opponent." - David Crow

            "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

            1 Reply Last reply
            0
            • A ArielR

              I'm moving from VC6 to VC2005. This code.... class myAccessor { public: TCHAR m_EMPRESA[6]; SHORT m_TipoCpbte; BEGIN_COLUMN_MAP(CdboBajFactProvAccessor) COLUMN_ENTRY(1, m_EMPRESA) COLUMN_ENTRY(2, m_TipoCpbte) END_COLUMN_MAP() CString sEmpresa = "Esta Empresa"; strcpy( myAccessor.m_EMPRESA, sEmpresa ); myAccessor.m_TipoCpbte = 1; HRESULT hr = myAccessor.Insert(); I can't compile strcpy, invalid function. What function replace strcpy. Thanks

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

              Have you read the docs? The first sentence on the strcpy page reads: These functions are deprecated because more secure versions are available; see strcpy_s, wcscpy_s, _mbscpy_s.

              --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Hungarian notation FTW

              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