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
M

Mauro Leggieri

@Mauro Leggieri
About
Posts
43
Topics
6
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • AARRGGHHHH!!!!!
    M Mauro Leggieri

    To obfuscate variable type ;P

    The Lounge com functional question

  • Creating an .Obj File
    M Mauro Leggieri

    Hi, Adding the file as a custom resource and then using FindResource set of api's to access it, does not fit your needs? Regards, Mauro.

    C / C++ / MFC c++ data-structures tutorial question

  • C vs. C++ (VS2010)
    M Mauro Leggieri

    Put declarations inside

    extern "C" { }

    C & C++ uses different name mangling.

    C / C++ / MFC question c++ visual-studio help

  • goto... Who uses it?
    M Mauro Leggieri

    Days ago started to program a driver and remembered me that, altough in some places you can see try/leave/except blocks is modern code, because is programmed in plain C, "goto" is still used a lot mainly for cleanup purposes.

    The Lounge question learning

  • goto... Who uses it?
    M Mauro Leggieri

    Eddy Vluggen wrote:

    Do you have an example? After years in the trade, I have still to see the first instance where it actually improves readability/maintainability.

    Hi, In C/C++ for e.g. in a switch statement where you must share some portion of code. Although one can put that shared part inside another function, for visibility & tracking purposes, some times is better to have the code in the same screen avoiding scrolling up and down to follow the code. Believe it, is real but I cannot show company code. I don't remember which old Pascal guru told that but sometimes a goto is preferable instead of doing a lot of work to avoid its usage and make the code difficult to read. For the other side, as an assembly programmer... I see JMPs everywhere hehehe. Regards, Mauro.

    The Lounge question learning

  • Commodore 64
    M Mauro Leggieri

    Peek & Poke ruled the world.

    The Lounge html com

  • Asynchronous sockets
    M Mauro Leggieri

    Hi, With select you check if you can write to a socket or read data from it. But there are some things about performance... If you target Linux... it is best to use poll. If you can, group many sockets in one select call (usually max is 64 sockets). It you target Win2000 or later... try advanced io completion ports. The best thing. Best regards, Mauro H. Leggieri P.D.: Check setsockopt to make a socket non-blocking.

    C / C++ / MFC c++ com sysadmin help tutorial

  • Windows 7/Vista Cut/Copy/Paste file operations Coder or Team?
    M Mauro Leggieri

    If someone is interested: http://blogs.technet.com/markrussinovich/archive/2008/02/04/2826167.aspx[^]

    The Lounge collaboration question

  • TimerAPCProc() Not Being Called With SetWaitableTimer()
    M Mauro Leggieri

    Is the thread that creates the timer exiting too fast? Also read http://msdn.microsoft.com/en-us/library/ms681951(VS.85).aspx[^] to know when APC callbacks are called.

    C / C++ / MFC help question

  • Differences between vb.net and c#
    M Mauro Leggieri

    I didn't think it is a problem. In VB6 you must use the IS operator to check for Nothing values: If Var IS Nothing Then .... And I am almost sure that it was documented and the behavior you mention of comparing 2 variables when some o both are Nothing can give wrong results. Best regards, Mauro H. Leggieri

    Clever Code csharp question

  • Measurement of code quality
    M Mauro Leggieri

    Excuse me, I didn't find it :)

    The Lounge com

  • Measurement of code quality
    M Mauro Leggieri

    Funny! http://thenextweb.com/2009/04/30/valid-measurement-code-quality/[^]

    The Lounge com

  • One or many libraries?
    M Mauro Leggieri

    Yes. I was thinking in turning some libraries into dlls. I'm not friend of having an app of one .exe and lots of .dll, but sometimes there aren't other options. Best regards, Mauro.

    C / C++ / MFC question csharp c++ visual-studio json

  • Creating and Deleting a New Window
    M Mauro Leggieri

    You should set the pointer to the output window to NULL in the OnDestroy callback and override the PostNcDestroy function in order to add a "delete this;" statement. Best regards, Mauro H. Leggieri

    C / C++ / MFC c++

  • One or many libraries?
    M Mauro Leggieri

    Hi, Time ago I began to create some static libraries of functions/classes in that I frequently use in my apps. Classes that uses MFC stuff is in one library and the rest of the stuff classified in another five. I "think" (please confirm) that having multiple library files make manteniance and changes compiling faster. Also I "believe" that Visual Studio compiler will be smart enough to NOT include all the object files of classes I don't use in my final executable. The question, including my 2 "thinks" above, is: "using separate library files has a real benefit?" Thanks, Mauro.

    C / C++ / MFC question csharp c++ visual-studio json

  • Chill in my Googalalia : "how much do they know" ?
    M Mauro Leggieri

    Hi, Hotmail, GMail, Yahoo and any kind of mail are PUBLIC. People should realize that, if they want real privacy, they should use applications like PGP and/or digital signatures. Open the mail to view the encripted data and decrypting it outside, in notepad for e.g. It is like the stupid thing of recording a call I a say "bomb". If I am a terrorist I won't use phones or anything that has no a strong encryption. Best regards, Mauro.

    The Lounge java question lounge

  • Thanks for the missing warning
    M Mauro Leggieri

    Yes, but like I said before, the preprocesor replaces the macro with a value. If it were a variable the discussion would be different... but it is a simple number. C/C++ parser: If token = number and it is alone... just ignore it. Regards, Mauro.

    Clever Code game-dev help

  • Thanks for the missing warning
    M Mauro Leggieri

    Yes, but it is a value :) Best regards, Mauro.

    Clever Code game-dev help

  • Thanks for the missing warning
    M Mauro Leggieri

    With C# i'm checking if the text "resistance is futile" is true.

    Clever Code game-dev help

  • Thanks for the missing warning
    M Mauro Leggieri

    Hi, five minutes ago I was debugging a game I'm making and while tracing on this fragment of code: #define XBALLOON_TYPE_1 0x01 #define XBALLOON_TYPE_2 0x02 #define XBALLOON_TYPE_3 0x04 k = 0; if (nPosX < 332)   k |= XBALLOON_TYPE_1; if (nPosY < cBalloon.GetHeight()) {   nPosY += y2;   k |= XBALLOON_TYPE_2; } if (bBalloonIsThinking != FALSE)   XBALLOON_TYPE_3; ... I noticed that never could step in "if (bBalloonIsThinking != FALSE)". The error is that the code should be: if (bBalloonIsThinking != FALSE)   **k |=** XBALLOON_TYPE_3; But with the missing "k |=", the compiler (VS2005, in their default warning settings) says 0 errors, 0 warnings. Assume you are the compiler and found this: if (bBalloonIsThinking != FALSE)   0x04; At least, I suppose you will insult me. Best regards, Mauro.

    Clever Code game-dev help
  • Login

  • Don't have an account? Register

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