Migrating from VS 6 to .NET 2005

Posted on 2004-11-07
Last Modified: 2010-04-24
I'm looking into moving from Visual Studio 6 to Visual Studio .NET 2005. We have a very large MFC application that we would like to build and run using .NET 2005. At this point we are not interested in using managed code just converting.

We use strncpy to build a record to insert into a DB table. Because of this I'm getting a lot of warnings:
    warning C4996: 'strncpy' was declared deprecated

I don't want to turn off the warning; it may be gone in the release version of .NET 2005 or future releases. I'd like to fix it now.

Is there a replacement to strncpy in .NET?

Thanks for the help,
Question by:BrianM_AZ
    LVL 55

    Accepted Solution

    LVL 55

    Expert Comment

    by:Jaime Olivares
    As you can see, there is a new replacement function, strncpy_s(), but pay attention because it have differerent arguments and return value.
    LVL 55

    Expert Comment

    by:Jaime Olivares
    More detail on strncpy_s in page 15 of this document:

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
    In Easy String Encryption Using CryptoAPI in C++ ( I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now