can't offer code, but have a look at std::string, from the C++ standard library.. (#include ) - it has members such as find_first_of() and replace() that you should be able to use quite easily to perform the CString::Replace() functionality. happy coding!
Nick Blumhardt
Posts
-
CString::Replace in C++ without MFC -
SQL Server connection sharingHi everyone :) I'm not sure if this is possible, but I was wondering if there was a way for two threads to concurrently (and reasonably independently) share an SQL Server connection, such as the OLE DB templates CDataSource object? Presently, my attempts have been serialised internally by SQL Server, so that the net effect is that one of the requests must complete before the other can begin... thanks to anyone who can offer some pointers! nb
-
CEdit subclassingHi All, I have a pretty simple CEdit subclass that paints its background with a texture bitmap. When I use it in multi-line mode, with more text than will fit in the window, scrolling upward doesn't cause WM_ERASEBKGND to be sent, and so the top lines are drawn over the old content (yuk!). I've tried handling WM_CTLCOLOR- doesn't make any difference. Any ideas? Thanks NB
-
the joys of windows nt securityHi all, the exe I've just coded is used by an ASP page running on IIS to generate a zip file containing some XML goo, for download by a client problem being, the file I create is not public... so it looks like I need to use SetFileSecurity() or SetNamedSecurityInfo() to make it visible the trouble is, i'm totally lost trying to use these functions- can anyone point me towards a good, quick example ? thanks :) peace :rose:
-
Dynamic allocation of multidimensional arraysthis is the perfect place for some cool template code :) any takers?
-
1984ha :) I wonder if John Howard's leigions are collecting snaps of our faces :rolleyes:
-
1984The current events, and particularly their coverage in the US media, which was more like nationalistic warmongering, have led me to comparing the state of public affairs in the US to George Orwell's famous book... not such a pretty thing. Now that the US government are considering so many new intrusions into the freedom of its people (encryption backdoors, facial recognition cameras, easier arrests of non-nationals) I can imagine that the days of exercise in front of the telescreen each morning might not be so far away. Is the US brand of capitalism finally showing itself to have much the same teleology as its antithesis? I know many are beginning to look on America with fearful reservations (but not you, my American friends). ??
-
XML Support in SQL Server - does ANYONE use it?... trying to get a FOR XML rowset back out through ADO/ASP now, and its becoming a nightmare! strings I select like this: SELECT '<hello/<' are just great, but something simple like: SELECT blah FROM blogg FOR XML AUTO, ELEMENTS gives me rubbish, like: ?colname??L?anothercol?a??somethingelse?andmoreshite which isn't making much sense to me, unless its a UNICODE problem... thanks in advance if anyone can help Nick
-
Sending XML directly to a template using SQL Server & IISHi all, I'm trying to use IXMLHTTPRequest to send an XML document (from a C++ client app) to a template on a SQL Server. It appears IIS support is configured properly, because putting the document directly in the url works - like this: http://myserver/virtualdir/templates/mytemplate.xml?doc='<root/>' The template is:
<ROOT xmlns:sql='urn:schemas-microsoft-com:xml-sql'>
sql:header
<sql:param name='doc'>'default'</sql:param>
sql:header
sql:query
exec usp_MySP @doc
</sql:query>
<ROOT>In code, I open an IXMLDOMDocument, and load xml into it. Then, I open an IXMLHTTPRequest and send the document:
hr = pIXMLHttpRequest->open(\_bstr\_t(\_T("POST")), \_bstr\_t(\_T("http://myserver/virtualdir/templates/mytemplate.xml")), \_variant\_t(VARIANT\_FALSE), \_variant\_t(""), \_variant\_t("")); hr = pIXMLHttpRequest->setRequestHeader(\_bstr\_t(\_T("Content-type")), \_bstr\_t(\_T("application/xml"))); hr = pIXMLHttpRequest->send((IDispatch \*)pDoc);
The stored procedure always gets the default parameter, not whatever document I pass in. Thanks for any help with this cryptic stuff Cheers NB
-
the insert code thingy.. :)thanks, john!
-
the insert code thingy.. :)I know this has been revealed several times, but I can't remember for the life of me.... what is the tag to insert code into posts? thanks \ \n
-
Mail from an NT Serviceall of the classes from 1.21, I believe, also compiled into a dll that exports a 'quick & easy' PJSendMail() function (perfect for what I needed to do!) you can download the code at http://naughter.com/download/pj\_smtp\_stl.zip
-
Mail from an NT ServiceBTW, there are some classes available through PJ Naughter's site that port Naughter's code from MFC to STL, which saved me a great hassle. As you said, very easy to use, did the trick fantastically.
-
Mail from an NT Servicethanks, giles, i'll have a look at them :)
-
Mail from an NT ServiceI've tried using CDO's IMessage (in a very simple manner), but for some reason it calls int 3 ... ? ... and just generally dies with a message about an invalid heap pointer deep in the cdo code.
-
Mail from an NT ServiceHi all, I'm having great problems sending email from an NT service- the only place I've found it mentioned was in MSDN referring to Extended MAPI X| Given that I don't want to go to such great lengths to do it, can anyone let me know of a way to send email from a service? All I need to do is send a simple message to a recipient. Thanks very much for any help. Cheers NB
-
STL thoughtsGreat! Mike, you just hit on my biggest woe with using STL (which I love). Thanks. On the topic, does anyone know of a good *online* STL reference? I've seen a few wonderful paper versions, but it would be handy to keep something searchable on my machine- and I don't trust any of the documentation in MSDN.... Often, I come across something wonderful in STL (like the string tokenising noted above) and feel like singing and dancing... :) everyone here is a bit sus on the STL and I have to keep quiet :( The solution... an STL forum!!! I know we have a VC++ forum, but it's kind of in a different vein to what I mean... Chris? cheers NB
-
Name your most hated technologyimmediately i read this post, i scanned down the replies for 'crystal' ;P
-
coloured scroll barsAre the coloured scroll bars (on the codeproject website if you have IE5.5+) able to be achieved in C++ apps? i.e., is there a new version of the common controls with an extended FlatSB api or what??? Would be so perfect for some stuff we're doing here. Nb
-
Sending Email in Win32oops- MAPI is what I was looking for :-O