[comp.windows.ms.programmer] Gawd I love this shit. Q about strings in windows

lwallace@javelin.es.com (Lynn Wallace) (03/04/91)

I've found that many of the string functions~ don't work in Windows, 
particularly strcpy.  I haven't been able to find any discussion of string
manipulation in the dox, particularly the Guide to Programming.  Can anyone
point me to a good discussion of it, or possibly point out some caveats?

Ya know, what I'm trying to write is really not that complicated.  But whenever
I try something new (meaning something I simply haven't tried under Windows
but have done many times in other environments) it takes several days to figure
out some silly little extra thing I've got to do to make it work.  Assuming
I'm successful at all and don't end up kludging a way around it.  This is the
first and last application I will try to write using just the SDK.
-- 
Lynn Wallace			   |I am not an official representative of
Evans and Sutherland Computer Corp.| <- E&S.  Or for that matter, unofficial.
Salt Lake City, UT 84108	   |Internet: lwallace@javelin.sim.es.com
			War not make one great! -- Yoda

cadsi@ccad.uiowa.edu (CADSI) (03/04/91)

From article <1991Mar3.194444.26873@javelin.es.com>, by lwallace@javelin.es.com (Lynn Wallace):
> I've found that many of the string functions~ don't work in Windows, 
> particularly strcpy.  I haven't been able to find any discussion of string
> manipulation in the dox, particularly the Guide to Programming.  Can anyone
> point me to a good discussion of it, or possibly point out some caveats?
> 
> Ya know, what I'm trying to write is really not that complicated.  But whenever
> I try something new (meaning something I simply haven't tried under Windows
> but have done many times in other environments) it takes several days to figure
> out some silly little extra thing I've got to do to make it work.  Assuming
> I'm successful at all and don't end up kludging a way around it.  This is the
> first and last application I will try to write using just the SDK.

	Welcome to the world of SDK!  The strxxx functions in general aren't
what you want.  If you use the SDK's lstrcpy and other such functions, things
will probably work out.  Windows in general wants to mess with far pointers.
depending on your memory model during compilations, strcpy will use far or
near pointers, exclusive or I mean.  This info is really in the dox as you put
it.

poffen@sj.ate.slb.com (Russ Poffenberger) (03/06/91)

In article <1991Mar3.194444.26873@javelin.es.com> lwallace@javelin.es.com (Lynn Wallace) writes:
>I've found that many of the string functions~ don't work in Windows, 
>particularly strcpy.  I haven't been able to find any discussion of string
>manipulation in the dox, particularly the Guide to Programming.  Can anyone
>point me to a good discussion of it, or possibly point out some caveats?
>
>Ya know, what I'm trying to write is really not that complicated.  But whenever
>I try something new (meaning something I simply haven't tried under Windows
>but have done many times in other environments) it takes several days to figure
>out some silly little extra thing I've got to do to make it work.  Assuming
>I'm successful at all and don't end up kludging a way around it.  This is the
>first and last application I will try to write using just the SDK.

There are windows specific versions of most of those types of functions.
Windows deals with LPSTR data types (FAR pointer strings) and you need to use
the functions provided for that purpose. If I remember right, they are pretty
much prepended with an l (lstrcpy, etc.)

Russ Poffenberger               DOMAIN: poffen@sj.ate.slb.com
Schlumberger Technologies       UUCP:   {uunet,decwrl,amdahl}!sjsca4!poffen
1601 Technology Drive		CIS:	72401,276
San Jose, Ca. 95110             (408)437-5254

goodearl@world.std.com (Robert Goodearl) (03/06/91)

In article <1991Mar6.004213.2305@sj.ate.slb.com> poffen@SunOS (Russ Poffenberger) writes:
>In article <1991Mar3.194444.26873@javelin.es.com> lwallace@javelin.es.com (Lynn Wallace) writes:
>>I've found that many of the string functions~ don't work in Windows, 
>
>There are windows specific versions of most of those types of functions.
>Windows deals with LPSTR data types (FAR pointer strings) and you need to use
>the functions provided for that purpose. If I remember right, they are pretty
>much prepended with an l (lstrcpy, etc.)
>
As of C 6.0, there are also model independent functions for string manipulation
and file manipulation.  I don't have the manuals here at hand, but I believe
-- 
Bob Goodearl -- goodearl@world.std.com

ebergman@isis.cs.du.edu (Eric Bergman-Terrell) (03/06/91)

Look up lstrcpy, etc. in the docs.  It, like some of the other string
routines, expects far pointers to strings (LPSTR).

Terrell