Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
B

BadJerry

@BadJerry
About
Posts
590
Topics
71
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • My son, the programmer
    B BadJerry

    Whou could be that cruel to his own blood?

    The Lounge learning c++ python game-dev question

  • My son, the programmer
    B BadJerry

    Yes - it looks cool - I have watched a few tutorials and that seems very elegant! Thanks

    The Lounge learning c++ python game-dev question

  • My son, the programmer
    B BadJerry

    ha ha

    The Lounge learning c++ python game-dev question

  • My son, the programmer
    B BadJerry

    First 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?

    The Lounge learning c++ python game-dev question

  • Forgive me, Father, for I have sinned.
    B BadJerry

    Did you add a DoEvents() so it looked like it was multithreading?

    The Lounge announcement

  • Regular expressions send different result in Visual Studio 2010 and Visual Studio 2008
    B BadJerry

    The 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

    C / C++ / MFC visual-studio regex csharp question

  • ParseExact - parsing a date with a given format in C++ / MFC
    B BadJerry

    Thanks 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

    C / C++ / MFC c++ csharp json help question

  • ParseExact - parsing a date with a given format in C++ / MFC
    B BadJerry

    That's clever!

    C / C++ / MFC c++ csharp json help question

  • ParseExact - parsing a date with a given format in C++ / MFC
    B BadJerry

    Yes but I want to parse not to format! Thanks! Jerry

    C / C++ / MFC c++ csharp json help question

  • ParseExact - parsing a date with a given format in C++ / MFC
    B BadJerry

    Thanks 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,

    C / C++ / MFC c++ csharp json help question

  • ParseExact - parsing a date with a given format in C++ / MFC
    B BadJerry

    Hello, 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

    C / C++ / MFC c++ csharp json help question

  • CHtmlView for FireFox and other browsers
    B BadJerry

    Ooooh and this http://code.google.com/p/chromiumembedded/[^]

    C / C++ / MFC c++ html com question

  • CHtmlView for FireFox and other browsers
    B BadJerry

    I found this as well https://developer.mozilla.org/en/Gecko_Embedding_Basics[^] If anyone has experience on this - I am interested!

    C / C++ / MFC c++ html com question

  • CHtmlView for FireFox and other browsers
    B BadJerry

    Oh you good man! Thank you!

    C / C++ / MFC c++ html com question

  • CHtmlView for FireFox and other browsers
    B BadJerry

    Hello! 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

    C / C++ / MFC c++ html com question

  • Book tip on iPhone programming
    B BadJerry

    Ha ha! Watch this space!

    The Lounge ios c++ question learning

  • Wikipedia is trying to freak me out
    B BadJerry

    Who isn't? ;)

    The Lounge com question lounge learning

  • Book tip on iPhone programming
    B BadJerry

    I 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!

    The Lounge ios c++ question learning

  • Book tip on iPhone programming
    B BadJerry

    Ha 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 (;

    The Lounge ios c++ question learning

  • Book tip on iPhone programming
    B BadJerry

    I 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 ;)

    The Lounge ios c++ question learning
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups