Thread: Using CStirng in .c file

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    68

    Using CStirng in .c file

    I define this below data in .c file

    Code:
    CString m_data;
    when I compile there are these error message
    Code:
    error C2065: 'CString' : undeclared identifier
    error C2146: syntax error : missing ';' before identifier 'm_data'
    error C2065: 'm_data' : undeclared identifier
    Do you know how to solve my problem?
    Thank you.

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793

    Re: Using CStirng in .c file

    Originally posted by ooosawaddee3
    I define this below data in .c file

    Code:
    CString m_data;
    when I compile there are these error message
    Code:
    error C2065: 'CString' : undeclared identifier
    error C2146: syntax error : missing ';' before identifier 'm_data'
    error C2065: 'm_data' : undeclared identifier
    Do you know how to solve my problem?
    Thank you.
    Did you try it in a .cpp file? I'm not sure but I think MSVC++ compiles according to the type of file you use...and as CString is an MFC class....it wont work in C

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Include window.h.

    Kuphryn

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A development process
    By Noir in forum C Programming
    Replies: 37
    Last Post: 07-10-2011, 10:39 PM
  2. File transfer- the file sometimes not full transferred
    By shu_fei86 in forum C# Programming
    Replies: 13
    Last Post: 03-13-2009, 12:44 PM
  3. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 04:54 PM
  4. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 10:12 PM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM