Re: VC2005 Pro: IDE (Compiler ?) can't find Stdafx.h



Many thanks for all the detailed feedback. (and thanks to Mark R. too).
Everything seems to be just fine.
For new code I would obviously use UNICODE but for existing stuff
that I just want to maintain \ slightly modify, your suggestions just solve
the problems comfortably.

Regards,
David


"John Carson" <jcarson_n_o_sp_am_@xxxxxxxxxxxxxxx> wrote in message
news:#0V7If1CGHA.628@xxxxxxxxxxxxxxxxxxxxxxx
> "David F" <David-White@xxxxxxxxxxxxx> wrote in message
> news:3_isf.548$Hl6.486@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> > Following your suggestion, the stdafx, etc. problems are obviously
> > gone and successful compile+link worked.
> > The program seems to run correctly but useless since using older
> > code, from when I used main() rather than _tmain(), creates UI
> > problems, where I can't provide parameters, etc.
>
> By default, projects are set up to use Unicode. If you want to use ANSI
> characters, go to Project->Properties and, under
>
> Configuration Properties->General,
>
> you should set
>
> Use Character Set
>
> to
>
> Use Multi-Byte Character Set
>
> instead of the default Unicode.
>
> That is all that should be necessary to get your old code to work (at
least
> as far as character sets are concerned).
>
> If you want to use main() rather than _tmain for platform independence
> reasons, then you can easily change that manually, though this will make
no
> difference when running under Windows.
>
> > Even if I ignore the effort of converting everywhere from char to
> > _TCHAR and all associated functions, etc.(which by itself is nothing
> > to sneeze at), I simply don't like to use none C++ standards (even if
> > I need to write few more lines here and there), propriery stuff such
> > as _TCHAR. (Remember the big debates in this forum about the
> > propritery / non-portable terms BOOL, INT, INT32 instead of bool,
> > int, etc.?)
>
> We disagreed on that for the most part.
>
> > What is your best idea about converting from '_TCHAR** argv to
> > 'char** argv' or any other idea to minimize the maximum "damage",
> > especially when using existing and otherwise well proven working
> > source code and perhaps on these issues in a larger picture context
> > altogether?
>
> If you use TCHAR etc., and want your code to run on another platform, then
> all you need do is create a file for that platform that appropriately
> defines the various things you use, e.g., for a platform that only
supported
> chars, you would declare
>
> typedef char TCHAR;
>
> Any C++ compiler that isn't completely broken will happily accept that.
>
> Of course if you use Windows-specific functions that take TCHAR arguments,
> then you are going to have portability problems simply because you are
using
> Windows-specific functions, with or without the use of TCHAR.
>
> Alternatively, you can make the project setting changes I described above
> and code entirely in terms of chars. This has its own "portability"
problems
> of a different sort if you want to write international software with
> multiple language UIs.
>
> --
> John Carson
>
>


.



Relevant Pages

  • Re: Window types
    ... typedef WCHAR TCHAR, * PTCHAR; ... typedef char TCHAR, * PTCHAR; ... Under a Unicode build, ... If the only text your app needs to deal with can be handled with ASCII ...
    (microsoft.public.vc.language)
  • Re: passing char * to dll
    ... char is a single byte thing so there are only 256 different possible values. ... This makes it difficult to have fonts of more than 256 characters. ... Unicode is a way of having all possible characters (latin, chinese, arabic, ... The idea was that you write your code using TCHAR everywhere and TCHAR is ...
    (microsoft.public.vc.mfc)
  • Re: VC2005 Pro: IDE (Compiler ?) cant find Stdafx.h
    ... Use Multi-Byte Character Set ... > _TCHAR and all associated functions, ... If you use TCHAR etc., and want your code to run on another platform, then ... typedef char TCHAR; ...
    (microsoft.public.vc.language)
  • Re: Unicode and ANSI strings in the same project
    ... If you don't there will be all sorts of problems passing CStrings, TCHAR and TCHAR *, variables from a function in one file to one in another. ... I changed most of my char variables to TCHAR and all the associated stuff like strlento _tcslen. ... In some places I used WCHAR explicitly etc) as I changed my document file format to contain unicode strings before I changed the program to use unicode everywhere. ...
    (microsoft.public.vc.language)
  • Re: passing char * to dll
    ... char is a single byte thing so there are only 256 different possible values. ... This makes it difficult to have fonts of more than 256 characters. ... Unicode is a way of having all possible characters in a single set. ... To make the transition as painless as possible Microsoft invented the transitional type TCHAR. ...
    (microsoft.public.vc.mfc)