Mail Archives: cygwin/1998/01/28/20:08:35
This is a multi-part message in MIME format.
------=_NextPart_000_017B_01BD2C24.70F39BA0
Content-Type: text/plain;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable
Hi,=20
I've problem with saving text files.
Can you tell me what's wrong with this code:
=20
hEdit - EDIT window=20
=20
int saveFile(char *filename)
{
char buff[256];
int i;
int size;
int lines =3D SendMessage(hEdit, EM_GETLINECOUNT, 0, 0);
int fh =3D open(filename, O_WRONLY | O_CREAT);
for(i =3D 0; i < lines; i++)
{
((int *)buff)[0] =3D 254;
size =3D SendMessage(hEdit, EM_GETLINE, i, (LPARAM)buff);
buff[size] =3D 0x0d; // CR
buff[size+1] =3D 0x0a; // LF
write(fh, buff, size+1);
}
close(fh);
=20
Thanx,
Daniel Mironowicz miron-the-master AT usa DOT net
------=_NextPart_000_017B_01BD2C24.70F39BA0
Content-Type: text/html;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>
<META content=3Dtext/html;charset=3Diso-8859-2 =
http-equiv=3DContent-Type><!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 =
HTML//EN"><!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN"><!DOCTYPE HTML =
PUBLIC "-//W3C//DTD W3 HTML//EN">
<META content=3D'"MSHTML 4.71.2016.0"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 size=3D2>Hi, </FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>I've problem with saving text=20
files.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>Can you tell me what's wrong with =
this=20
code:</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2>hEdit - EDIT =
window</FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2>int saveFile(char=20
*filename)<BR>{<BR> char =
buff[256];<BR> int=20
i;<BR> int size;<BR> int lines =3D=20
SendMessage(hEdit, EM_GETLINECOUNT, 0, 0);<BR> int fh =
=3D=20
open(filename, O_WRONLY | O_CREAT);<BR> for(i =3D 0; i =
<=20
lines; i++)<BR> =20
{<BR> ((int *)buff)[0] =3D=20
254;<BR> size =3D =
SendMessage(hEdit,=20
EM_GETLINE, i, =
(LPARAM)buff);<BR> =20
buff[size] =3D 0x0d; //=20
CR<BR> buff[size+1] =3D=20
0x0a; // =
LF<BR> =20
write(fh, buff, size+1);<BR> }<BR> =20
close(fh);<BR></FONT> </DIV>
<DIV>Thanx,</DIV>
<DIV> </DIV>
<DIV>Daniel=20
Mironowicz &nb=
sp; =20
<A=20
href=3D"mailto:miron-the-master AT usa DOT net">miron-the-master AT usa DOT net</A></DI=
V></BODY></HTML>
------=_NextPart_000_017B_01BD2C24.70F39BA0--
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -