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
S

Scot Brennecke

@Scot Brennecke
About
Posts
7
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • The application has failed to start....
    S Scot Brennecke

    C:\Program Files\Common Files\Merge Modules

    Scot Brennecke Software Developer VC++ MVP

    COM c++ workspace csharp visual-studio question

  • C++ ATL DLL Addin for Windows Mail is blocked by Vista's DEP
    S Scot Brennecke

    The ATL in VC++ 7.1 and earlier makes use of thunk code that requires executing code from a data block. The DEP feature prevents that. Here is a KB article I wrote on the subject: Applications Using Older ATL Components May Experience Conflicts With DEP: http://support.microsoft.com/kb/948468

    Scot Brennecke Software Developer VC++ MVP

    COM c++ visual-studio csharp security help

  • Null'ing structures
    S Scot Brennecke

    OK, since you want to "fight" about it... ;) = {0} is not strictly equivalent to the ZeroMemory approach. Most significantly, if your struct is declared on the stack, you do not get what you want: "If initializer-list has fewer values than an aggregate type, the remaining members or elements of the aggregate type are initialized to 0 for external and static variables. The initial value of an automatic identifier not explicitly initialized is undefined." Scot Brennecke Software Developer VC++ MVP

    C / C++ / MFC

  • CListCtrl OnKeyDown message.
    S Scot Brennecke

    I'm not sure what differences you have between now and two days ago, but it sounds like you're being bitten by IsDialogMessage. Certain keystrokes are trapped by the system and treated as dialog navigation keys, rather than being sent to the control. Besides direction keys, this also includes things like Tab. Try adding a handler for WM_GETDLGCODE to your control. Return DLGC_WANTARROWS. Scot Brennecke Software Developer VC++ MVP

    C / C++ / MFC c++ database debugging help question

  • Null'ing structures
    S Scot Brennecke

    It's all about making readable code for yourself and others, weeks after you write it. = {0} works. But it's not as obvious that the entire structure will be zeroed. ZeroMemory usually gets compiled as memset with 0, but ZeroMemory is much clearer to read. Back in the days when drive space and memory was expensive, it paid to write very small source code. We learned to be VERY thrifty with every byte, at the expense of readability. But the cost of maintenance should not be underestimated. If you can save another programmer just 2 minutes by making the code easier to read and understand, you've justified the use of a few extra bytes of source code. Scot Brennecke Software Developer VC++ MVP

    C / C++ / MFC

  • EnumProcesss
    S Scot Brennecke

    The problem is that the process set is very volatile. Processes get started and stopped very regularly, without user intervention. Even if you could determine immediately prior to calling EnumProcesses how many there were, there's no reason to believe the count will be the same by the time EnumProcesses executes. So, just make a wild-ass overestimate of the count, and hope for the best. I'm sure that with statistical analysis, you could determine a value that has a 99.99% probability of being sufficient. But memory is cheap, right? Make your best guess at how many there will be -- and double that. Even if you allow for 1000 processes, that's just 4000 bytes. Scot Brennecke Software Developer VC++ MVP

    C / C++ / MFC help question

  • CString Objects & subString :: MFC
    S Scot Brennecke

    Certainly! The Mid() function has two overloads. In both cases, the first parameter is the starting index of the substring. If you pass a second parameter, it is the count of characters in the substring to return. Or if only one integer is passed, the remainder of the string is returned. Scot Brennecke Software Developer VC++ MVP

    C / C++ / MFC c++ question
  • Login

  • Don't have an account? Register

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