Whou could be that cruel to his own blood?
BadJerry
Posts
-
My son, the programmer -
My son, the programmerYes - it looks cool - I have watched a few tutorials and that seems very elegant! Thanks
-
My son, the programmerha ha
-
My son, the programmerFirst post in many many years... and things have changed. He has my good looks, my dislike of mornings and a better English accent... him being English and me French - it's tense during the 6 nations. And he is my son, 14 of age... but probably already more mature than I ever was. He has been learning Python at school for a year or so - that and pseudo-code. He now wants to have a go at programming games. And he'd like a book for Christmas. I am a C++ programmer but I have not touched game programming since the days of Oric 1, Zx spectrum and Atari 800 when I programmed in Basic (ahem if this comes out, I know it's you!) and (some) assembler. What should I advise him to read and learn?
-
Forgive me, Father, for I have sinned.Did you add a DoEvents() so it looked like it was multithreading?
-
Regular expressions send different result in Visual Studio 2010 and Visual Studio 2008The following code returns isMatch true in VS 2008 not in VS 2010
CString strPattern = \_T("(\\\\+|00)\\\\s\*\\\\d{2}(\\\\s?\\\\d{3}){2}\\\\s?\\\\d{4}"); CString strValue = \_T("0044 207 689 0000"); CT2CA pszFind(strPattern); const std::tr1::regex pattern(pszFind ,std::tr1::regex\_constants::nosubs | std::tr1::regex\_constants::ECMAScript); CT2CA pszData(strValue); std::string strSearch(pszData); isMatch = regex\_search(strSearch.begin(), strSearch.end(), pattern);
Any idea why? Thanks in advance
-
ParseExact - parsing a date with a given format in C++ / MFCThanks again... but this is to return a string with a format... What I wanted is to parse a string into a date with a format! Something like
COleDatetime t;
t.IsThisStringADateWithThisFormat(_T("10012012"),"ddMMyyyy");But I have managed (see my post above)! Thanks anyway! Jerry
-
ParseExact - parsing a date with a given format in C++ / MFCThat's clever!
-
ParseExact - parsing a date with a given format in C++ / MFCYes but I want to parse not to format! Thanks! Jerry
-
ParseExact - parsing a date with a given format in C++ / MFCThanks Jochen And Richard, Yes I used an OpenSource version of strptime() that I found here: http://plibc.sourceforge.net/doxygen/strptime_8c-source.html[^]- and I have transformef the char(s) into TCHAR, added _T, etc.... and I ave written this:
{
...
CString strFormatCpp = TranslateFormatDate(strFormatVB);tm timeDate; memset(&timeDate,0,sizeof(tm )); TCHAR \* pRes = strptime (strMyDate, strFormatCpp, &timeDate); if ( pRes != NULL ) { COleDateTime oleDate; oleDate.SetDateTime(1900 + timeDate.tm\_year,timeDate.tm\_mon+1,timeDate.tm\_mday,timeDate.tm\_hour,timeDate.tm\_min,timeDate.tm\_sec); }
}
CString TranslateFormatDate(const CString & strFormat)
{
CString strResult;
int nChar = 0;
while ( nChar < strFormat.GetLength() )
{
switch ( strFormat[nChar] )
{
case 'A':
if ( MatchFormatKey(_T("AMPM"),_T("%p"),strFormat, nChar,strResult) )
continue;
break;
case 'a':
if ( MatchFormatKey(_T("ampm"),_T("%p"),strFormat, nChar,strResult) ) // Lower does not exist in C++?
continue;
case 'y':
if ( MatchFormatKey(_T("yyyy"),_T("%Y"),strFormat, nChar,strResult) )
continue;
if ( MatchFormatKey(_T("yy"),_T("%y"),strFormat, nChar,strResult) )
continue;
break;
case 'M':
if ( MatchFormatKey(_T("MMMM"),_T("%B"),strFormat, nChar,strResult) )
continue;
if ( MatchFormatKey(_T("MMM"),_T("%b"),strFormat, nChar,strResult) )
continue;
if ( MatchFormatKey(_T("MM"),_T("%m"),strFormat, nChar,strResult) )
continue;
if ( MatchFormatKey(_T("M"),_T("%#m"),strFormat, nChar,strResult) )
continue;
break;
case 'd':
if ( MatchFormatKey(_T("dddd"),_T("%A"),strFormat, nChar,strResult) )
continue;
if ( MatchFormatKey(_T("ddd"),_T("%a"),strFormat, nChar,strResult) )
continue;
if ( MatchFormatKey(_T("dd"),_T("%d"),strFormat, nChar,strResult) )
continue;
if ( MatchFormatKey(_T("d"),_T("%#d"),strFormat, nChar,strResult) )
continue;
break;
case 'h':
if ( MatchFormatKey(_T("hh"),_T("%I"),strFormat, nChar,strResult) )
continue;
if ( MatchFormatKey(_T("h"),_T("%#I"),strFormat, nChar,strResult) )
continue;
break;
case 'H':
if ( MatchFormatKey(_T("HH"),_T("%H"),strFormat, nChar,strResult) )
continue;
if ( MatchFormatKey(_T("H"),_T("%#H"),strFormat, -
ParseExact - parsing a date with a given format in C++ / MFCHello, I need a function that would do a parse exact on a CString - given a format - and return a date (or an exception!) Eg COleDateTime timParsed; timParsed.ParseExact("2002 10 3","yyyy mm d"); I am aware of ParseDateTime... but I need something where you actually specify the expected format! And I knoe ParseExact is in .net but hey I am stuck in the nineties! Any idea? Thanks! Jerry
-
CHtmlView for FireFox and other browsersOoooh and this http://code.google.com/p/chromiumembedded/[^]
-
CHtmlView for FireFox and other browsersI found this as well https://developer.mozilla.org/en/Gecko_Embedding_Basics[^] If anyone has experience on this - I am interested!
-
CHtmlView for FireFox and other browsersOh you good man! Thank you!
-
CHtmlView for FireFox and other browsersHello! I am woring on an MFC app that previews a html page... it works with CHtmlView which uses Internet Explorer. Is there a way I could preview using FireFox or any installed browsers? Some sort of ActiveX control... I would like to stay within the app... and trap events (like form submission and ajax) Any pointers welcome! Jerry
-
Book tip on iPhone programmingHa ha! Watch this space!
-
Wikipedia is trying to freak me outWho isn't? ;)
-
Book tip on iPhone programmingI think the CP team is eager to widen their readership... and if you give a .NET angle, it would be perfect! I am porting some MFC code to iPhone - and I have had to rewrite (or borrow) code for CString and COleDateTime - I will try to share the code when I have a bit of time!
-
Book tip on iPhone programmingHa ha - that will be an option depending on the success of the Windows Phone and the the future of Silverlight... quite a bet at this stage! But now you are entioning Windows Phone - is there any way to use (unmanaged) C++ dlls on these? ooops that's a programming question (;
-
Book tip on iPhone programmingI have managed to compile and use some legacy code in C++ but you're right for anything GUI related I need to get my hand dirty with Objective C... and I mean dirty ;)