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

Search:

Type: Posts; User: 2kaud

Page 1 of 80 1 2 3 4

Search: Search took 0.08 seconds; generated 33 minute(s) ago.

  1. Thread: IDC resource

    by 2kaud
    Replies
    1
    Views
    6

    Re: IDC resource

    The radio buttons that should act together need to be in the same group control. It looks like the new button isn't part of the existing group.
  2. Replies
    10
    Views
    484

    Re: wait .. no blocking

    plus Windows events, mutexs, semaphores etc etc etc

    We only use Windows and our main threading code was written before C++11. We looked into moving to std::threads etc but we concluded that the...
  3. Replies
    10
    Views
    484

    Re: wait .. no blocking

    Sorry, but I don't use std::threads either.
  4. Thread: array of objects

    by 2kaud
    Replies
    14
    Views
    820

    Re: array of objects

    @EE

    I commented out SetThreadPriority() just for my testing - as it wasn't part of the issue.

    inline static int count{}; //this line gives error in v14.0 platform - You need to update your...
  5. Thread: array of objects

    by 2kaud
    Replies
    14
    Views
    820

    Re: array of objects

    Since C++17, you use inline with static. See my code above.

    However, the problem is with the std::thread(). You need to pass obj[i] by address - not by value. The way you're doing it means that...
  6. Replies
    4
    Views
    326

    Re: threads and function call

    I don't use C++ multi-threading - we used Windows threading prior to threads being introduced into C++ and have stuck with this since.

    However, with multi-threading you have to make sure that...
  7. Thread: array of objects

    by 2kaud
    Replies
    14
    Views
    820

    Re: array of objects

    Correct. This is how the code should work.

    This behaviour is caused by the call to vector constructor. You are passing 10 and MyClass() as arguments. This means create 10 elements and initialise...
  8. Thread: array of objects

    by 2kaud
    Replies
    14
    Views
    820

    Re: array of objects

    As I said above, post a complete compilable test program that shows the issue.
  9. Replies
    4
    Views
    326

    Re: threads and function call

    What do you mean by a 'shared header'? a and b are passed by value and the return is also by value - so there's no side-effect from calling the function. So the function itself is thread-safe. But...
  10. Thread: array of objects

    by 2kaud
    Replies
    14
    Views
    820

    Re: array of objects

    Post a complete compilable test program that shows the issue.
  11. Replies
    2
    Views
    295

    Re: Creating a popup window above an another.

    [Also asked at http://www.cplusplus.com/forum/windows/280300/ ]
  12. Replies
    8
    Views
    416

    Re: #warning and MSVC

    How many of them are there?

    Can you use a #ifdef ... to choose between the 2 versions depending upon the compiler used? Something like:



    #if defined (_MSC_VER)
    #pragma message("message")...
  13. Replies
    8
    Views
    416

    Re: #warning and MSVC

    How about #pragma message ?

    https://docs.microsoft.com/en-us/cpp/preprocessor/message?view=msvc-160

    #pragma NOTE is not listed as a supported #pragma for MSVS.
  14. Replies
    8
    Views
    416

    Re: #warning and MSVC

    If #warning is just to display a warning message at compile time, then perhaps #pragma comment ??

    https://docs.microsoft.com/en-us/cpp/preprocessor/comment-c-cpp?view=msvc-160
  15. Replies
    8
    Views
    416

    Re: #warning and MSVC

    In MSVS it's #pragma warning. See https://docs.microsoft.com/en-us/cpp/preprocessor/warning?view=msvc-160
  16. Replies
    2
    Views
    374

    Re: inline code - what are MSVC's "rules"

    Are these of any help?

    https://devblogs.microsoft.com/cppblog/inlining-decisions-in-visual-studio/
    https://docs.microsoft.com/en-us/cpp/build/reference/ob-inline-function-expansion?view=msvc-160...
  17. Re: Is there a function intended to split strings by a delimiter in VC++?

    Nice - using &*

    The underlying issue is with .end() which doesn't seem to be as expected. But using the &* trick you can remove the need to construct the string, giving just:



    inline auto...
  18. Re: Is there a function intended to split strings by a delimiter in VC++?

    Even simpler:



    #include <string_view>
    #include <algorithm>
    #include <iterator>
    #include <iostream>
    #include <iomanip>
    #include <ranges>
  19. Re: Is there a function intended to split strings by a delimiter in VC++?

    That code doesn't compile with any of the compilers used with godbolt (gcc/clang et al)... However I'm not convinced that the compilers are currently totally conforming for std::ranges.

    From MSDN:
  20. Re: Is there a function intended to split strings by a delimiter in VC++?

    This compiles OK:



    #include <string_view>
    #include <algorithm>
    #include <iterator>
    #include <iostream>
    #include <sstream>
    #include <iomanip>
  21. Replies
    4
    Views
    492

    Re: Compatible C++ libraries Questions.

    [Also asked here http://www.cplusplus.com/forum/general/279988/ ]
  22. Replies
    4
    Views
    492

    Re: Compatible C++ libraries Questions.

    2) Yes. see std:chrono.

    https://en.cppreference.com/w/cpp/chrono
  23. Re: Is there a function intended to split strings by a delimiter in VC++?

    Note that strtok changes the data and cannot be nested. It needs to be used with std::string::data() (C++17 and later only) as it is a c function.
  24. Re: Does a static class var work in a static lib ?

    It's been too long since I last used dynamic .dlls. We don't use them any more as we consider there's too many problems with them... :)

    Why not create a simple test program and find out? That's...
  25. Replies
    13
    Views
    759

    Re: Where can I get User32.lib file?

    Yes - but you get the latest c/c++ compilers etc etc. There's been huge changes to the languages since 1997! I used to use Borland as well way back then!
Results 1 to 25 of 1982
Page 1 of 80 1 2 3 4





Click Here to Expand Forum to Full Width

Featured