> "David W" <no@email.provided> wrote in message
>>
[quoted text clipped - 5 lines]
> Coupled with a fundamental misunderstanding of what a pair of double quotes
> does in C++.
No, I know what a pair of double quotes does in C++.
> In VB, that gives you a quote character inside your string,
Do you assume I'm a VBer who's new to C++? I've been writing C++ for >10 years.
I've hardly touched VB and know almost nothing about it.
> in C++ it ends one string and starts another, which the preprocessor helpfully
> stitches together (it's useful when one of the strings is a macro expansion).
Not necessarily anything to do with this problem, which is in _resource_ code,
not C++ code. For all I knew, resource code might or might not use C++ rules for
these things. I had no idea what it's rules were, which is why I asked.
> What you want is to use the backslash to correct escape quotes, generating
> quotes inside the string:
> "#include \"apptype.h\"\r\n"
This is the resource code that the IDE's own wizard produces when you ask it to
create a skeleton MFC application. Note the double quotes.
3 TEXTINCLUDE
BEGIN
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
"#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
"LANGUAGE 9, 1\r\n"
"#pragma code_page(1252)\r\n"
"#include ""res\\Temp.rc2"" // non-Microsoft Visual C++ edited
resources\r\n"
"#include ""afxres.rc"" // Standard components\r\n"
"#include ""afxprint.rc"" // printing/print preview resources\r\n"
"#endif\r\n"
"\0"
END
And this is the text that results from the above:
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE 9, 1
#pragma code_page(1252)
#include "res\\Temp.rc2" // non-Microsoft Visual C++ edited resources
#include "afxres.rc" // Standard components
#include "afxprint.rc" // printing/print preview resources
#endif
#endif // not APSTUDIO_INVOKED
David
David W - 21 Feb 2007 23:57 GMT
> No, I know what a pair of double quotes does in C++.
I meant either a pair of quotes or double quotes, but not both.
David
Ben Voigt - 22 Feb 2007 16:18 GMT
> No, I know what a pair of double quotes does in C++.
>
>> In VB, that gives you a quote character inside your string,
>
> Do you assume I'm a VBer who's new to C++? I've been writing C++ for >10
> years. I've hardly touched VB and know almost nothing about it.
Sorry about the misinformed statements then. I simply would say that when
the strings already contain C++ escape sequences (\r\n), then other C++
escape sequences would most likely work. I suspect that \" will produce the
desired behavior, and would certainly be far more consistent with C++ code.
Resource files are run through the C preprocessor, so many of the same rules
apply.