Search Results - CodeGuru Forums
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Codeplug

Page 1 of 74 1 2 3 4

Search: Search took 0.11 seconds.

  1. Re: Java "volatile" alternative in C++ under Windows?

    >> And for C++11 the manual very clearly states volatile is for hardware access only (interrupts on the same thread) and not to be used for multithreading, you should use the <atomic> stuff for...
  2. Re: Java "volatile" alternative in C++ under Windows?

    >> No they don't. or rather, the sync primitives don't do this in and by themselves.
    "Pull over, pull over - semantics police!"
    So they don't solve 1 and 2 in and by themselves, but by them being...
  3. Re: Java "volatile" alternative in C++ under Windows?

    Critical sections, and all Win32 synchronization primitives, solve 1 and 2.

    gg
  4. Re: Reduction of the flash footprint

    Some things that come to mind:
    Have a common base object with a virtual destructor that does nothing - then remove all other destructors. This should route all destrutor calls to the virtual base...
  5. Replies
    7
    Views
    295

    Re: strand vs multithreads

    It seems to me that 2 "strands" would be defined as 2 independent tasks that have no shared resources between them (or if they do, synchronization is involved).

    If so, then replacing threads with...
  6. Replies
    26
    Views
    1,903

    Re: A question regarding double-checked locking

    >> For c++11 rather than use a mutex, I use atomic compare_exchange for multi threaded singletons
    In my own Windows implementation, I use an interlocked add for the fast-path and a critical-section...
  7. Re: static class member in multithreaded environment

    >> Simultaneous read/write access to global resources from multiple threads needs a more careful planned approach than just willy nilly making stuf atomic.
    +1 :thumb:

    >> you should prefer atomic...
  8. Re: How to determine cross platform type during file save?

    I would detect the line ending style when opening an exist files and preserve it. When saving a new file, you could have an option settings for the default ending style to use or just ask the user...
  9. Replies
    8
    Views
    402

    Re: Hash table efficiency

    I've implemented a couple of dynamic hash tables for different applications in the past. They needed O(x) guarantees and so they were implemented by hand and there was no rehashing. In other words,...
  10. Replies
    3
    Views
    287

    Re: Showing console Windows in a Win 32 DLL

    Have the user provide a handle for where the DLL should send its output. Then the user can provide a console handle, file, pipe, etc..

    gg
  11. Replies
    26
    Views
    1,903

    Re: A question regarding double-checked locking

    >> Definitely no.
    Definitely yes. More reading: http://preshing.com/20130930/double-checked-locking-is-fixed-in-cpp11/#using-a-c11-static-initializer
    The rest of that post is good reading too.

    gg
  12. Replies
    26
    Views
    1,903

    Re: A question regarding double-checked locking

    With a compliant C++ implementation, this really all you need:


    static simpleSingleton* getInstance()
    {
    static simpleSingleton s_instance;
    return &s_instance;
    }
    If your compiler...
  13. Replies
    12
    Views
    651

    Re: WMI Get() fail

    Correct again. I've been relying on RAII objects just "doing the right thing" for too long :)

    gg
  14. Re: Access a username/password protected url through C++

    >> ... and MSVCR120.dll in the Cinema 4D folder
    That should be handled by the appropriate VS runtime redistributable. (eg. http://www.microsoft.com/en-us/download/details.aspx?id=30679)

    You could...
  15. Re: Access a username/password protected url through C++

    Didn't see your last post...

    Well, you wouldn't want to link statically to GPL source (without purchasing a license to do so). And some may even require a license to be used in a commercial...
  16. Re: Access a username/password protected url through C++

    What protocols are used when accessing your server? Is it plain HTTP? Through TCPIP or TLS (SSL)?

    What libraries did you use to achieve this access on MacOS?

    gg
  17. Replies
    12
    Views
    651

    Re: WMI Get() fail

    >> ... documentation on Get says it takes care of that ...
    You are correct. My mistake.

    >> One nice thing about using _com_ptr_t, _variant_t, and _bstr_t ...
    One unfortunate thing is that there...
  18. Replies
    12
    Views
    651

    Re: WMI Get() fail

    >>Sample attached.
    Review:
    A call to VariantInit() is missing (though the variant's initial values are not used in this case).
    The VariantClear() call could be moved up 2 if blocks.
    The call to...
  19. Replies
    12
    Views
    651

    Re: WMI Get() fail

    http://cboard.cprogramming.com/cplusplus-programming/120547-how-do-you-access-information-win32_operatingsystem-class.html#post900756

    gg
  20. Replies
    12
    Views
    651

    Re: WMI Get() fail

    One of your problems is the you are using an uninitialized variant and safearray. You'll want to use ATL's wrappers for these objects - CComVariant etc.

    gg
  21. Replies
    30
    Views
    2,229

    Re: how send the class pointer with SetTimer()?

    >> Think WinAPI if the task is about WinAPI!
    Are you saying that we should just be calling ::SetTimer in order to accomplish the task? Or that we should re-do everything in MFC in order to use its...
  22. Replies
    30
    Views
    2,229

    Re: how send the class pointer with SetTimer()?

    >> Make Simple Tasks Simple!
    I couldn't agree more.

    The "task" in this case - and the reason for my participation in this thread - is to have ::SetTimer() callbacks into a C++ object instance...
  23. Replies
    30
    Views
    2,229

    Re: how send the class pointer with SetTimer()?

    I'll choose a solid C++ interface over a C interface any day. I won't let a few lines of code stop me from creating one either.

    If you have object instances that need their methods called on a...
  24. Replies
    30
    Views
    2,229

    Re: how send the class pointer with SetTimer()?

    #include <Windows.h>
    #include "WinTimerDispatch.h" // post #19
    #include <iostream>

    //------------------------------------------------------------------------------

    class Timer
    {
    protected:...
  25. Replies
    30
    Views
    2,229

    Re: how send the class pointer with SetTimer()?

    This is what I use:


    #ifndef WIN_TIMER_DISPATCH
    #define WIN_TIMER_DISPATCH

    #include <windows.h>
    #include <map>
    ...
Results 1 to 25 of 1839
Page 1 of 74 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center