Solved

CString in linux

Posted on 2003-10-23
7
1,936 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

747 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

10 Experts available now in Live!

Get 1:1 Help Now