Solved

Basic question about string class for C++ .NET

Posted on 2003-11-26
10
453 Views
Last Modified: 2010-08-05
I want to use a string class which does not require any additional DLLs, so that the exe I compile can run on a clean build win95 box simply by copying the exe. Whenever I try to use string, String or CString in C++ it seems to require additional components. When I added mscorlib.dll (.net framework) it was ok. What I need is a string class which does not need .net framework. I also need a registry class and some classes for handling arrays would be nice.

I found a few string classes on the web but who can you trust ?

Main things I need are things like split, join, replace etc etc functionality

Would be nice if my resulting code remained compiler independent but its OK to lock into win32 platforms.

Full points for a solution that gets me bug free string class and a registry class which works without external dlls (kernel, user advapi etc are acceptable)
0
Comment
Question by:xassets
[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
10 Comments
 
LVL 14

Expert Comment

by:Tommy Braas
ID: 9829997
I would suggest that you use the standard classes and Standard Template Library classes provided standard with most C++ compiler. A word of warning: any MS C++ compiler does not support the full definition of the C++ language.

For verification purposes, using GCC is a good idea! GCC can be downloaded for free at
   http://www.gnu.org/directory/devel/compilers/gcc.html

It seems to me however that you're linking to the .NET framework, instead of to the crt (c runtime). Have a look at your linker settings in your project, make sure that you're not linking to the .NET runtime.

Arguments above are also true for accessing the registry. I don't think that there is a class abstraction for the registry, however the API calls are easy to follow.
0
 
LVL 8

Expert Comment

by:_corey_
ID: 9830251
You want to use .NET framework without .NET framework installed?
0
 
LVL 13

Expert Comment

by:SteH
ID: 9830282
Be sure to check projects settings to use the non DLL version of the C run time library. At least in VC6 you had the option between single threaded, multi threaded and multi threaded DLL. The last needs then DLLs to be copied with the project, whereas the others don't.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Author Comment

by:xassets
ID: 9830446
Definitely a beginner to VC, .NET and C++, but on a mission to get 10k lines of vb rewritten to C++ in a few days!

I'm just using the .NET compiler because its already installed. It seems to be similar to VC6 and I can write simple hello world programs which will run on win95 with only copying the exe (no dlls or .net framework). I just need to be able to use string classes etc and hopefully a registry class (apis are fine, wrappers would be nice), and still be able to install on win95 just by copying the exe.

Don't want to use the .net framework - just want an exe that works on its own, don't care if I have to use .net or vc6, they seem similar to me!

Checked the project settings and can't really see anything for C run time library, the MFC setting is "Use Standard Windows Libraries".

0
 
LVL 14

Expert Comment

by:Tommy Braas
ID: 9830487
I would recommend that you have a look at the compiler and linker settings for the simple Hello World sample project and mimic those settings in your own project.
0
 
LVL 4

Author Comment

by:xassets
ID: 9830915
I have been unable to find a hello world sample which uses a string class and does not require a dll. Thats definitely all i need
0
 
LVL 4

Author Comment

by:xassets
ID: 9850618
Question aborted, went the straight C route instead

Thanks to those who contributed
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 9879333
xassets,
Please finalize this question.  See http:/help.jsp#hs5
-- Dan Rollins, EE C++ area Page Editor
0
 

Accepted Solution

by:
PashaMod earned 0 total points
ID: 9901062
Question closed and poitns refunded

PashaMod
CS Moderator
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

751 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