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.06 seconds.

  1. Re: std::vector::emplace_back vs std::vector::push_back

    Consider this test class and the generated output from various uses of puish_back() and emplace_back():



    include <vector>
    #include <iostream>

    struct mytype {
    int a {};
    int b {};
  2. Re: std::vector::emplace_back vs std::vector::push_back

    emplace back enables the arguments of a class/struct constructor to be specified without the requirement to create another instance of the class.

    As a simple example, consider:



    #include...
  3. Replies
    4
    Views
    626

    Re: Creating a Virtual Desktop in Windows ?

    Sorry, I've never gone into virtual desktops. I just use virtual machines.

    However, Windows does support multiple Stations each with multiple Desktops. Would this be of any help? See...
  4. Re: How to use the TEA Algorithm to deal with human readable text

    As a simple example of use with a text file, consider this. It takes an input file in plain text, encrypts to an output file and then decrypts the output file to the decrypted file in plain text.

    ...
  5. Re: How to use the TEA Algorithm to deal with human readable text

    As I said in my previous post, TEA operates on 2 32-bit numbers. It takes 2 numbers as input and produces 2 numbers as output. If you want this to operate with text, then for encryption you have to...
  6. Replies
    4
    Views
    648

    Re: Catching OS exceptions

    You might find more info here https://docs.microsoft.com/en-us/windows/win32/debug/structured-exception-handling

    It seems there are various windows functions that can be used for dealing with...
  7. Replies
    4
    Views
    648

    Re: Catching OS exceptions

    I think you're referring to Microsoft SEH - which uses _try _except _finally. The options are set under Code Generation

    See...
  8. Re: How to use the TEA Algorithm to deal with human readable text

    So the contents of the input file is as given above? You are expecting the output file to be readable? What are expecting the output file to contain?

    decipher() returns 2 32-bit numbers via w...
  9. Replies
    5
    Views
    597

    Re: Memory leaks detected

    There are several issues with the code when using with union. The code below compiles and runs OK with VS2019:



    #include <vector>
    #include <string>
    #include <iostream>

    enum {INTEGER_TYPE =...
  10. Replies
    5
    Views
    597

    Re: Memory leaks detected

    Are you sure that ValuueType should be a union and not a struct? A union is a special class type that can hold only one of its non-static data members at a time. but in the constructor for ValuueType...
  11. Re: Resizing WinAPI Windows Console without text rearranging?

    Just looked into it. Appears you can't sub-class the windows console. Sorry.

    Have a look at:...
  12. Re: Resizing WinAPI Windows Console without text rearranging?

    Ah. You might be able to subclass the console window and trap the WM_SIZE message and ignore it et al. Not tried though.
  13. Re: Resizing WinAPI Windows Console without text rearranging?

    It will auto-adjust text in the console window between newlines (or begin newline/newline end) to suit the size of the window. This is a 'feature' of the console. If you have say a width of 80 with a...
  14. Replies
    1
    Views
    615

    Re: Destructors in C++

    class ctest {
    public:
    ctest(size_t sz) : ptrs(new int[sz]), sze(sz) {} // Constructor

    ~ctest() { delete[] ptrs; } // Destructor to delete allocated memory

    private:
    size_t sze {};...
  15. Replies
    12
    Views
    6,230

    Re: What book have you recently read?

    Currently reading the new best-seller by Rainer Grimm - C++20. Great read! Available from leanpub.com
  16. Re: Error: No Operator

    You haven't provided a compilable example. Are the 2 sets of code in different compilation units? if yes, is max_price() declared in a header file used by the compilation unit that has main() ?
  17. Re: Basic questions about VC runtimes and compatibility

    There is the c run time (CRT) and what is needed for MFC.

    For CRT, if this is statically linked, then the .exe includes the required CRT. For dynamically linked CRT, then the appropriate CRT...
  18. Re: Excel Crash using a new MS Office 365(16.0) ACEDAO.DLL

    The standard calling convention for c/c++ programs is __cdecl where the stack is cleaned up by the caller. Windows functions often use __stdcall where the stack is cleaned up by the callee (WINAPI is...
  19. Replies
    16
    Views
    2,542

    Re: A 'customised' std::list ??

    The Bug has now been reported to the VS team and is now 'Under Investigation'. I'll update when there is more info.

    Nice workaround! I'd never of thought of that as that using unused... line...
  20. Replies
    16
    Views
    2,542

    Re: A 'customised' std::list ??

    The code compiles OK with both gcc and clang as C++17 or as C++20 with a change for unique. See https://wandbox.org/permlink/tfhEOLLXuzGTdh7J

    The issue is only with VS. Hence I've moved this to...
  21. Replies
    16
    Views
    2,542

    Re: A 'customised' std::list ??

    I'd change it to C++17 - and re-compile everything.

    This C++17 example code demonstrates the problem:



    #include <list>

    using LT = std::list<int>;
    using func_t = void(LT::*)();
  22. Replies
    16
    Views
    2,542

    Re: A 'customised' std::list ??

    In VS2019, for the project/properties/general/C++ Language standard

    What's the value? Preview means using C++20 which has return values for these functions. C++17 and previous had return void for...
  23. Replies
    16
    Views
    2,542

    Re: A 'customised' std::list ??

    That's probably the issue. All the lines which now don't compile are those that reference functions that no longer return void, but have a return value - as of C++20! eg for C++20, unique() returns a...
  24. Replies
    16
    Views
    2,542

    Re: A 'customised' std::list ??

    What version of lua are you using? The latest version is 5.4.2

    There's also info on the internet as to how to use lua with C++ and classes as lua seems to be written in C. I've never used it.
  25. Replies
    16
    Views
    2,542

    Re: A 'customised' std::list ??

    My response in my post #2 is based upon what I remember reading some time ago (MSDN blog post?) about some changes to the way Microsoft implement some class member functions which would have some...
Results 1 to 25 of 2000
Page 1 of 80 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)