Solved

CString in linux

Posted on 2003-10-23
7
2,279 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
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 pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

630 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