This is a multi-part message in MIME format.

------=_NextPart_000_0042_01C6F5F5.F257F0C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Is there a way to make this work ?

char pszString[80];

pszString[0] =3D 0x00;

::strcat( pszString, "Set objXL =3D =
WScript.CreateObject("Excel.Application")\n\n" );



I can't make the 3rd line work because of the double quotation marks

------=_NextPart_000_0042_01C6F5F5.F257F0C0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1491" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Is there a way to make this work =
?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#0000ff>
<P><FONT face=3DArial size=3D2>char</FONT></FONT><FONT face=3DArial =
size=3D2>=20
pszString[80];</FONT></P>
<P><FONT face=3DArial size=3D2>pszString[0] =3D 0x00;</FONT></P>
<P><FONT face=3DArial size=3D2>::strcat( pszString, "Set objXL =3D=20
WScript.CreateObject("Excel.Application")\n\n" );</FONT></P>
<P><FONT face=3DArial size=3D2></FONT>&nbsp;</P>
<P><FONT face=3DArial size=3D2>I can't make the 3rd line work because of =
the double=20
quotation marks</FONT></P></DIV></BODY></HTML>

------=_NextPart_000_0042_01C6F5F5.F257F0C0--

Re: strcat problem by Alex

Alex
Sun Oct 22 18:31:48 CDT 2006

You need to escape quotation marks:

"...CreateObject(\"Excel.Application\")\n\n" );
^ ^
here and here


HTH
Alex



Re: strcat problem by David

David
Mon Oct 23 07:09:46 CDT 2006

Rob wrote:

> Is there a way to make this work ?
>
> char pszString[80];
>
> pszString[0] = 0x00;
>
> ::strcat( pszString, "Set objXL = WScript.CreateObject("Excel.Application")\n\n" );
>
>
>
> I can't make the 3rd line work because of the double quotation marks
>

Rob:

This has nothing to do with strcat. In C/C++ you always have to escape
the double quote like this

\"

How else can the compiler know where the string ends?

David Wilkinson