• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2899
  • Last Modified:

CString in linux

can I use CStrings in linux? if so what headers do i need to include?
0
GaryJoe
Asked:
GaryJoe
  • 5
  • 2
1 Solution
 
AxterCommented:
You would have to copy the MFC *.cpp implementation file and the header file.

Most of CString will work in Linux/Unix, however you'll have some problems with the CString::Format function.
0
 
AxterCommented:
You'll find the implementation in the STRCORE.CPP file:
MICROSOFT VISUAL STUDIO\VC98\MFC\SRC\STRCORE.CPP

0
 
jkrCommented:
>>can I use CStrings in linux?

No. Use STL strings instead, they are portable. See http://www.msoe.edu/eecs/cese/resources/stl/string.htm
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
AxterCommented:
The class declaration is in the AFX.H file.
0
 
jkrCommented:
>>You'll find the implementation in the STRCORE.CPP

Well, but I strongly doubt that using it on Linux is covered by the MFC license :o)

// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (C) 1992-1998 Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.
0
 
AxterCommented:
There is a replacement class for CString (called CStr) on www.codeguru.com that will work on UNIX/Linux
Check out the following link:
http://codeguru.earthweb.com/string/index.shtml
0
 
AxterCommented:
>>Well, but I strongly doubt that using it on Linux is covered by the MFC license :o)

I was answering the question from a technical view point, and not a legal view point.
But you're correct.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now