Thread: CString conversion for socket send()

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    >> ....so used the variable type DWORD
    DWORD is basicaly an unsigned int. Aren't Code-128 barcodes alpha-numeric?

    You can use functions like wcstombs() to convert a wchar_t string to a char string. So you can keep using a CString for you edit-box, and convert it to a char string where you need it.

    gg

  2. #2
    Registered User
    Join Date
    May 2004
    Posts
    164
    Hey codeplug, thanks for looking again,
    I attempted to follow MSDN's example of wcstombs() with the following code and got barked at with an error:
    Code:
    string bc;
    		wcstombs (bc, m_Barcode, NULL);
    	m_BarCode += bc;
    m_Barcode is my edit box CString
    bc just being a string I use to store my conversion and then add it to my string m_BarCode.

  3. #3
    Registered User
    Join Date
    May 2004
    Posts
    164
    Sorry codeplug I forgot to send the error message, that might help identify where I am messing up.

    Code:
     error C2664: 'wcstombs' : cannot convert parameter 1 from 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' to 'char *'
            No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
    C:\TRANSFERLAP\MEATPLANT\Mobile\MobileDlg.cpp(186) : error C2593: 'operator =' is ambiguous

  4. #4
    Registered User
    Join Date
    May 2004
    Posts
    164
    I finally figured out the example on MSDN, and the conversion is working well. Codeplug, Thanks a Million, that worked great!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  2. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  3. Problem with Visual C++ Object-Oriented Programming Book.
    By GameGenie in forum C++ Programming
    Replies: 9
    Last Post: 08-29-2005, 11:21 PM
  4. Header File Question(s)
    By AQWst in forum C++ Programming
    Replies: 10
    Last Post: 12-23-2004, 11:31 PM
  5. Help with CString class and operator+ overloading
    By skanxalot in forum C++ Programming
    Replies: 2
    Last Post: 10-07-2003, 10:23 AM