Solved

CString in linux

Posted on 2003-10-23
7
1,964 Views
Last Modified: 2008-01-09
can I use CStrings in linux? if so what headers do i need to include?
0
Comment
Question by:GaryJoe
  • 5
  • 2
7 Comments
 
LVL 30

Expert Comment

by:Axter
ID: 9608489
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
 
LVL 30

Expert Comment

by:Axter
ID: 9608514
You'll find the implementation in the STRCORE.CPP file:
MICROSOFT VISUAL STUDIO\VC98\MFC\SRC\STRCORE.CPP

0
 
LVL 86

Accepted Solution

by:
jkr earned 125 total points
ID: 9608519
>>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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 30

Expert Comment

by:Axter
ID: 9608526
The class declaration is in the AFX.H file.
0
 
LVL 86

Expert Comment

by:jkr
ID: 9608550
>>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
 
LVL 30

Expert Comment

by:Axter
ID: 9608564
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
 
LVL 30

Expert Comment

by:Axter
ID: 9608573
>>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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

911 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

19 Experts available now in Live!

Get 1:1 Help Now