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
A

Andy Moore

@Andy Moore
About
Posts
148
Topics
12
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • STL Map
    A Andy Moore

    You are responsible for deleting the pointer objects yourself. Another approach is to use a reference-counted smart pointer like boost::shared_ptr.

    Pax Domini sit semper vobiscum

    ATL / WTL / STL performance c++ question

  • Possible to have a two-way Associative Arrays
    A Andy Moore

    Look at boost::bimap. http://www.boost.org/doc/libs/1_39_0/libs/bimap/doc/html/index.html[^]

    Pax Domini sit semper vobiscum

    ATL / WTL / STL data-structures question

  • STL string::const_iterator problem converting code from VC6 to VS2008.
    A Andy Moore

    Why not bool bstat = boost::regex_search(ssource_pos.begin(), ssource_pos.end(), what, re, mflags)?

    Voici, la jeune femme est enceinte, elle va enfanter un fils et elle lui donnera le nom d'Emmanuel.

    ATL / WTL / STL c++ regex help perl html

  • Bleeding Edge
    A Andy Moore

    This has become an annoying cliché.

    Pax Domini sit semper vobiscum

    Buzzword Bingo

  • Fast search of a vector of strings
    A Andy Moore

    This will not return a string but an iterator to the matching string. Your code would look something like this.

    bool Comparer : public std::binary_function<wchar_t*, wchar_t*,bool>
    {
    public:
    bool operator()(const wchar_t* s1, const wchar_t* s2) const
    {
    return (wcscmp(s1, s2) == 0);
    }
    };

    std::vector<wchar_t*> paths;
    std::vector<wchar_t*>::const_iterator it;

    it = std::find_if(paths.begin(), paths.end(), std::bind2nd(Comparer(), L"some string"));

    if (it != paths.end())
    {
    /*Found it*
    const wchar_t* sz = *it;
    }

    ...

    Pax Domini sit semper vobiscum

    ATL / WTL / STL graphics algorithms question

  • efficiency copy vector into a second vector
    A Andy Moore

    std::vector vec1; std::vector vec2; std::copy(vec1.begin(), vec1.end(), std::back_inserter(vec2));

    Pax Domini sit semper vobiscum

    ATL / WTL / STL question graphics

  • Please enlighten me on STL iterators and CriticalSection locking
    A Andy Moore

    As far as I know STL does not do any critical section locking as that is left up to the application developer. We use STL (STLPort) extensively for high-performance server-side applications and find its performance outstanding. As far as thread safety goes I would look at the Adapative Communication Framework (ACE). This library has reader/writer locks so readers don't block each other accessing a cache but a write blocks all readers. If you have a cache that is primarily read-only then this is quite and efficient mechanism.

    Pax Domini sit semper vobiscum

    ATL / WTL / STL c++ performance question

  • C++ Book?
    A Andy Moore

    I recommend "C++ How to Program" by Deitel & Deitel. They are on the 4th edition right now, but I used the 2nd edition ten years ago when I learned C++ and still find it relevant even as an intermediate to advanced C++ programmer now. http://www.deitel.com/books/cpphtp4/[^]

    Pax Domini sit semper vobiscum

    The Lounge learning c++ question

  • Extract the file name from the full file path
    A Andy Moore

    How about PathFindFileName in shlwapi.dll?

    Pax Domini sit semper vobiscum

    C / C++ / MFC help

  • Cannot debug with PDBs
    A Andy Moore

    It is possible that the pdb is stripped of its symbols. This is done in deployment to lessen the install footprint. It is also possible that the pdb is not generated from the code that generated the dll.

    Pax Domini sit semper vobiscum

    C / C++ / MFC visual-studio csharp c++ debugging regex

  • push_back
    A Andy Moore

    Yes, vectors use contiguous memory so you can pass them to functions that take arrays like this. std::vector vecPoints; Polyline(hDC, &vecPoints[0], vecPoints.size);

    Pax Domini sit semper vobiscum

    C / C++ / MFC graphics performance

  • Defining HINSATNCE in C#
    A Andy Moore

    System.IntPtr

    Pax Domini sit semper vobiscum

    C# csharp c++ help

  • Hooking up Direct3D... but which one ?
    A Andy Moore

    Well, you can use Direct3D to draw 2D or 3D text to the screen in a game. Once you have the Direct3D device pointer you can call methods on it. So, you just need to do some research on the Direct3D API to figure out which functions you need to accomplish your task.

    Deus caritas est

    C / C++ / MFC question game-dev help tutorial

  • Is learning win32 only learning functions in dll?
    A Andy Moore

    I would disagree with you that learning Win32 is harder C#/Winforms. I agree that MFC is a PITA and makes Windows UI programming more difficult than need be. You end up getting HWNDs and calling thin wrappers around the Win32 calls anyway. In fact, learning the Win32 API is vital to the fundamentals in Windows UI programming and getting one's head around this ensures successful use of MFC, C#/Winforms, or whatever framework that Microsoft may come up with next. I see many programmers who cannot write custom controls or extend the Winforms controls to implement missing features because they are bound by this framework and don't have the fundamentals down. These frameworks wrap the Win32 API anyway, so if you really want to be a top-level Windows UI developer I suggest learning the Win32 API and fundamentals of Windows programming. This will serve you well.

    Deus caritas est

    C / C++ / MFC com question learning

  • Windows XP made VC++ Application not running in Windows 2000 Professional...??
    A Andy Moore

    Download the Dependency Walker application and run it on your DLL files. If you find a DLL with a function that has an exclamation point by it that means that that dependency is not resolved hence the dll cannot be loaded. This could be why your application is failing.

    Deus caritas est

    C / C++ / MFC c++ sysadmin question

  • keyboard and mouse
    A Andy Moore

    Look at the KeyPress and MouseMove events in the System.Windows.Forms namespace.

    Deus caritas est

    C# help question

  • Search DLL before P/Invoke?
    A Andy Moore

    No there is not. You could do interop to DllLoadLibrary to see if you can load the DLL this way. If it fails then the dll is not present.

    Deus caritas est

    C# question c++

  • Why do some people use HeapAlloc instead of malloc?
    A Andy Moore

    Across different OSs.

    Deus caritas est

    C / C++ / MFC question

  • Why do some people use HeapAlloc instead of malloc?
    A Andy Moore

    They are effectively the same. However malloc is in the C runtime libraries, so if you use it your application has to link in the C runtime. HeapAlloc is defined in kernel32.dll, so if you want to reduce the code size of your application you can avoid linking to the C runtime and use HeapAlloc to allocate memory. Using HeapAlloc may make your code less portable if that is a concern for you. I hope this helps.

    Deus caritas est

    C / C++ / MFC question

  • Instantiating a Generic templated class
    A Andy Moore

    You would do it like this: public class ForumList : IEnumerable where T : class, new() { public void CreateMe() { T myclass = new T(); } } I hope this helps.

    Deus caritas est

    C# com tools 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