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
R

Robin Imrie

@Robin Imrie
About
Posts
28
Topics
7
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Acronyms and expressions -- give us your best!
    R Robin Imrie

    A company I used to work for had a GUI program that ran on windows 3.1 for editing labels.. The support manager used to say "it was nearer WYSICUB than WISIWYG" WYSICUB = What you see is complete utter b****x

    Thanks, Robin.

    The Weird and The Wonderful business

  • Recommendations for source control
    R Robin Imrie

    :laugh: That made my day!

    Thanks, Robin.

    The Lounge csharp game-dev sysadmin question

  • if...else if.. & bad casting
    R Robin Imrie

    :thumbsup: :)

    Thanks, Robin.

    The Weird and The Wonderful css question announcement career

  • if...else if.. & bad casting
    R Robin Imrie

    I recently started a new job and my first project it to do a maintenance release of one of the companies products. Yesterday I found code like this...

    if ((CString)presuffixS.GetAt(i) == "%") { // Add ID, TYPE, FORMAT
    if ((CString)presuffixS.GetAt(i+1) == "i") {
    presuffix = presuffix + szDeviceID;
    i++;
    }
    else if ((CString)presuffixS.GetAt(i+1) == "t") {
    presuffix = presuffix + szType;
    i++;
    }
    else if ((CString)presuffixS.GetAt(i+1) == "n") {
    presuffix = presuffix + szId;
    i++;
    }

    // and so it continues for and other 6 if elses
    

    }

    Could it be any less efficient? I also found this technique used several other places too!

    Thanks, Robin.

    The Weird and The Wonderful css question announcement career

  • funny with boost::tribool
    R Robin Imrie

    It is yes and it was very confusing as I had similar code relating to comms where I was doing something like:

    if( !unit.Connected() || !unit.IsTypeA()
    {
    PrintFailMessage( "Failed to connect" );
    }

    and this worked just fine, but due to other reasons I changed my return type for the functions to boost::tribool and all of a sudden the IsTypeA() function was getting called first. Had me going for ages.

    Thanks, Robin.

    C / C++ / MFC help

  • funny with boost::tribool
    R Robin Imrie

    Looking further in to the tribool header file there is an overload for the || operator (and && operator) I am yet to look further into it to work out which parameter is which in the overload. I would of thought that an overridden || operator would or at least should work in the same way as it does with intrinsic types.

    Thanks, Robin.

    C / C++ / MFC help

  • funny with boost::tribool
    R Robin Imrie

    can any one explain why this code...

    #include <boost\logic\tribool.hpp>

    using namespace boost;
    using namespace std;

    tribool test1();
    tribool test2();

    int _tmain(int argc, _TCHAR* argv[])
    {
    if( !test1() || !test2() )
    cout << "test failed" << endl;

    return 0;
    

    }

    tribool test1()
    {
    cout << "test1" << endl;
    return true;
    }

    tribool test2()
    {
    cout << "test2" << endl;
    return false;
    }

    gives the following output.. test2 test1 test failed According to the documentation on the || operator the

    The operands of logical-AND and logical-OR expressions are evaluated from left to right. If the value of the first operand is sufficient to determine the result of the operation, the second operand is not evaluated. This is called "short-circuit evaluation." There is a sequence point after the first operand. See Sequence Points for more information.

    I fixed the "bug" by changing my if statement to

    if( !static_cast<bool>(test1()) || !static_cast<bool>(test2()) )

    I did notice in the disassembly that the boost function boost::logic::operator|| was being called and wonder if this what was effecting my logic. Thanks in advance

    Thanks, Robin.

    C / C++ / MFC help

  • I was waiting for one of these...
    R Robin Imrie

    or an oversized iPod Touch?

    Thanks, Robin.

    The Lounge php android com tools question

  • Problems with English MFC app on Chinese Windows
    R Robin Imrie

    Hi Anand, Thanks for your suggestion. I had suspected that building my application using unicode would solve my problem. I have heard back from our Chinese distributor this morning that the display issues are now resolved. Thanks, Robin.

    C / C++ / MFC help c++ testing beta-testing question

  • Problems with English MFC app on Chinese Windows
    R Robin Imrie

    Hi, I have written an MDI MFC (using VS2010) application which one of our distributors in China is testing. He is running Windows 7, Simple Chinese. The problem he has encountered are that for some of the dialogs the text shows ??? instead of the text. These dialogs are MFC ones i.e. prompt to save an unsaved file or response to a value beign out of range in a dialog. since all the remaining text from the application resources show without any problems I wonder if it may be down to the application using a "Multi-byte Charactor Set" and not unicode. (can't remember why I choose "Multi-byte Charactor set") Should I build the application as a Unicode application? and would this help pave the way for localised resources? thanks in advance Robin

    C / C++ / MFC help c++ testing beta-testing question

  • So time to change my mythology....
    R Robin Imrie

    I know of some sysadmin who use the names of the Sith for their windows servers and character from The Loard of the Rings for their Linux servers. The server room is called "The Shire"

    The Lounge sysadmin question

  • Should I buy that shiny new gadget?
    R Robin Imrie

    how about... 1. is an Apple XXXX? 2. do any of your mates have one? get 2 nos then go and buy it.

    The Lounge question com tutorial

  • DOS prompt
    R Robin Imrie

    Did anyone use 4Dos? If you did then you will like TCC/LE from JP Software. If you didn't then I think you will find it to be a good cmd.exe replacement.

    The Lounge sales

  • Books that made you a better programmer
    R Robin Imrie

    I would add: "The C++ Standard Library" by Nicolai Josuttis "Beyond the C++ Standard Library (an introduction to Boost) by Bjorn Karlsson "Network Programming for Microsoft Windows" by Anthony Jone & Jim Ohlund. I think this is now out of print. "Writing Solid code" by Steve Maguire

    The Lounge question career c++ html wpf

  • String conversion in c++/CLI
    R Robin Imrie

    Thanks mike for that i had suspected as much. Will give the C++/CLI articles a good look.

    Managed C++/CLI c++ question

  • String conversion in c++/CLI
    R Robin Imrie

    Hi, I am porting my vc2003 app to vc2008 and have come across somthing like this...

    // this defined
    LPCTSTR lpsz = _T("myString");

    // then later
    // where Afunc is defined as
    // SomeObject* AFunc( String *str );
    SomeObject *obj = Afunc( lpsz );

    under vc2003 this compiles and works file however in vc2008 it seems that i need to do...

    // this defined
    LPCTSTR lpsz = _T("myString");

    // then later
    // where Afunc is defined as
    // SomeObject^ Afunc( String ^str );
    SomeObject ^obj = Afunc( gcnew String(lpsz) );

    the documentation on string literals in C++/CLI migration primer suggest that the following could be done.

    SomeObject ^obj = AFunc( safe_cast<string^>(lpsz) );

    this is wrong as it not compile. I not sure the gcnew string( lpsz ) method is ideal. is there a better way or what is the propper way of doing this. thanks Robin

    Managed C++/CLI c++ question

  • Upgrading vc 2003 project to vc 2008
    R Robin Imrie

    I have a medium sized (27 projects) solution which has a mixture of project types, libs (both MC++ and C++), DLL's (both MC++ & C++) and exes all MC++. I am considering upgrading the project to vc 2008 mainly because this is the only project that I look after that needs VC 2003 and would like to use one development environment for everything. (have successfully upgraded all my VC2005 projects to VC2008) During the upgrade I was considering doing a 'proper' upgrade of all the code e.g. changing __gc class to ref class and using gcnew as required. Anyone know of any undocumented issues that might make this upgrade a failure or accelerate hair loss! Robin

    Managed C++/CLI c++ workspace

  • A career question
    R Robin Imrie

    <blockquote class="FQ"><div class="FQA">Christian Graus wrote:</div>I have no degree at all. The hard thing is getting the first job with no qualifications. I got lucky. From there, I worked hard, and now I have more work than I can deal with, and no-one ever asks what my qualifications are - my work history speaks for itself. </blockquote> I have a HND (similar to a degree) in electronics! Struggled for many years to get a job as a c/c++ programmer/engineer and finally got a break and have been programming ever since. I would like to add that over the past few years I have either interviewed or worked with people who are better qualified than myself and have found their knowledge, skill and fundamental understanding to be extremely poor and have had to spend time with them teaching them the basics. Which completely stuffed up my productivity. I think at the end of the day it is not just the academic ability that’s important but ability. Though unless you manage to have a break like Christian and myself then I think a degree could help that first door open after that it is the experience that counts.

    The Lounge question career learning

  • 32-bit or 64-bit Windows?
    R Robin Imrie

    This is a good article on running 64bit vista with 3+ Gb Ram & 32-bit apps.... [click^]

    The Lounge asp-net question announcement

  • Stupid variable names
    R Robin Imrie

    A couple of sys admin i know have named their server room "the shire" all the *nix server names have a LOTR theme to them and the windows servers are named after the sith. eg Darth Maul.

    The Weird and The Wonderful
  • Login

  • Don't have an account? Register

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