Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6242155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:54:15+00:00 2026-05-24T11:54:15+00:00

I have downloaded an sample code, so there are some CString variables in that

  • 0

I have downloaded an sample code, so there are some CString variables in that code which are passed to the sscanf() function as char* the compiler implicitly converts those CString and the code complie fine.the code which works fine is here:

CString m_strVersionXFS;
m_strVersionXFS = _T("00029903");

DWORD nVersion;
sscanf(m_strVersionXFS,"%08X",&nVersion);

the problem is here when i tried to write my own simple code which tries to manipulate a CString variable in the same way but the compiler says which can’t convert a CString to a cahr*

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T11:54:15+00:00Added an answer on May 24, 2026 at 11:54 am

    I suspect that your own code is using unicode (UNICODE constant defined). This means that CString is using wide characters, and will implicitly convert to wchar_t*, but not to char*.

    If that is the case, there are three possible solutions:

    1. Use swscanf, the wide character version of sscanf (recommended);
    2. Explicitly use CStringA instead of CString so you’re using the ANSI version of CString;
    3. Change your project to use multi-byte characters rather than unicode (this can be done from the project properties in Visual Studio).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's some sample code that I want to control using jQuery (white button bg
have downloaded Orca to edit an MSI file. I want to remove some banner
I have downloaded a font that looks less than desirable if it is not
I have a python application that relies on a file that is downloaded by
I have already asked this question on SuperUser but it was suggested there that
I have got some javascript code and I'd like to convert this to C#.
I have a script that appends some rows to a table. One of the
i have a input tag which is non editable, but some times i need
I´ve downloaded the UDPEcho sample code from Apple to make a simple UDP connection
The situation I am in is that I have written a perl script which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.