Re: Program entry point question!
- From: r_z_aret@xxxxxxxxxxxx
- Date: Mon, 12 Sep 2005 10:14:02 -0400
On Sun, 11 Sep 2005 21:01:05 -0700, "Robby"
<Robby@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>Hi I am trying my first VC++ program in VS7 and it works fine. However I have
>copied it to a new project in Embeded VCE and had to slightly modify the
>create window function, but thats OKAY.
>
>However what I don't understand is in the entry point function below:
>
>int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
> LPWSTR szCmdLine, int iCmdShow)
>
>I had to change the szCmdLine type from
>
>PSTR szCmdLine
>
>which was the way I had it for VC++
>
>to
>
>LPWSTR szCmdLine
>
>Why is Windows desktop type different from CE's type?
As Steve Maillet mentioned, Windows CE is heavily biased towards
UNICODE. He recommended switching completely to WCHAR, LPWSTR, etc.
and by always building for UNICODE. If you have no need to support
Windows 9x (95, 98, ME), this is a reasonable choice. Or you could
switch to TCHAR, LPTSTR, etc., which switch from char to WCHAR when
UNICODE is defined. But be _very_ careful about converting half way;
the compiler will catch almost, but not quite all, incompatibilities,
and run-time errors can be painful. I _strongly_ recommend taking some
time to learn about UNICODE. Using google to look up
UNICODE
in this newsgroup would be a good start. If you choose to use TCHAR
etc. (my preference), I strongly recommend reading the tchar.h header;
it is not meant for human readers (I sure needed several tries), but
defines TCHAR and is thus the authority.
>
>Any information is greatly appreciated!
-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).
Robert E. Zaret, eMVP
PenFact, Inc.
500 Harrison Ave., Suite 3R
Boston, MA 02118
www.penfact.com
.
- Follow-Ups:
- Re: Program entry point question!
- From: Steve Maillet \(eMVP\)
- Re: Program entry point question!
- References:
- Program entry point question!
- From: Robby
- Program entry point question!
- Prev by Date: CE 4.2, SQL CE Server 2.0
- Next by Date: Re: Program entry point question!
- Previous by thread: Re: Program entry point question!
- Next by thread: Re: Program entry point question!
- Index(es):
Relevant Pages
|