Smart questions
Smart answers
Smart people
Join Tek-Tips Forums
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

CrazyScorpion (Programmer) (OP)
8 Jul 10 19:41
The version of VS I'm using is VS 2005 Express
I'm trying to create a string object using the CString keyword.

The syntax is womething like the following:

CString Objective;

The compiler errors I'm receiving are:

1>c:\users\gary\documents\visual studio 2005\projects\r20modern\r20modern\Form1.h(146) : error C2146: syntax error : missing ';' before identifier 'Objective'
1>c:\users\gary\documents\visual studio 2005\projects\r20modern\r20modern\Form1.h(146) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\gary\documents\visual studio 2005\projects\r20modern\r20modern\Form1.h(146) : error C2144: syntax error : 'int' should be preceded by ';'
1>c:\users\gary\documents\visual studio 2005\projects\r20modern\r20modern\Form1.h(146) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
 
SDowd (Programmer)
9 Jul 10 9:36
What type of project is it?  are you including afx.h?  

http://www.physicsforums.com/showthread.php?t=277315

post number 10 says the express version does not have access to the MFC at all.  that may be your problem.   
xwb (Programmer)
9 Jul 10 14:35
You need to pull in MFC support for 2005 from full blown visual studio.  Alternatively, use WTL (http://sourceforge.net/projects/wtl/)

It is like MFC but uses templates instead of a massive library.  Also generates smaller code footprint and does not have a dependency on the different variants of the MFC dll.
CrazyScorpion (Programmer) (OP)
9 Jul 10 15:27
Thanks guys

I'll try to download the WTL. Are there any advantages to using that dll compared to MFC.
 
CrazyScorpion (Programmer) (OP)
9 Jul 10 15:30
BTW, SDowd, I'm not sure if I'm using AFX.h or not! I'm basically an C++ Builder coder, and havn't yet learned all the options that Microsoft offers me as yet!
xwb (Programmer)
10 Jul 10 2:39
WTL isn't a library as such - it is just a bunch of templates using the SDK.

CString probably still won't work.  You could try std::string (#include <string>) which is the STL way of doing things.  It doesn't do some of the formatting that CString does but it will do the basics like assignment, comparison and catenation.
xwb (Programmer)
10 Jul 10 2:53
Sorry take that back, CStrings do work in WTL.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close