I have a method LogFileContent(BSTR content).
I need to check the value which is present in content. I need to check for "Waiting for free XE Slot". If this string is present in content, i need to perform some executions.
How can I achieve this?
Regards
Last edited by p_zshk; August 4th, 2011 at 10:08 PM.
Reason: resolved
Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
Convenience and productivity tools for Microsoft Visual Studio: FeinViewer - an integrated GDI objects viewer for Visual C++ Debugger, and more...
Yes, of couse, as an option for the case that an exact match is not required. And as I interpreted the OP, it is. The closing sentence of my post was just to make sure wcscmp() is not the function of choice in case an exact match is not required.
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
actually my content will hold some extra text too...like "'Extraction ID: EBS_XE_1265635755_3326
Waiting for next XE free slot (20)
". out of which i need to match just the "Waiting for free XE Slot".
it is somewhat i need to do a pattern matching what we do in Oracle. My content will hold a longer text. of which I need to match for whether that text has "Waiting for free XE Slot" as a part of it or not...
How can i achieve this..??
Last edited by p_zshk; August 3rd, 2011 at 10:28 PM.
In this case VladimirF had the right instinct () and the function he suggested (and linked to its MSDN documentaion) is exactly what you need. It will return a pointer to the found partial string or NULL if it wasn't found. You're not actually interested in the location of the search hit, so check whether the return value is != NULL. If it is, the string you probed for is contained in the string you checked.
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
Bookmarks