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

  1. Re: VB application Uploading files(Blobs) into Oracle

    Try the sister vb site which has a more active VB forum.
    https://www.vbforums.com/forumdisplay.php?25-Visual-Basic-NET
  2. Re: find if any duplicates within the struct in a vector

    Then just do it as per the suggested function in post #4

    For m_nId2, just extend the condition check in the function.
  3. Re: find if any duplicates within the struct in a vector

    std::unique() removes duplicate entries - which is not what you want as duplicates are allowed. You need std::find_if() with the predicate lambda to check m_nId == <required value> this will iterate...
  4. Re: find if any duplicates within the struct in a vector

    You mention adding a warning message - so you want to insert the item even if m_nId is a duplicate?

    Is the vector sorted by m_nID?

    Unless the vector is sorted by m_nID, then adjacent_find() is...
  5. Replies
    10
    Views
    170

    Re: My simple vector crashes

    1) Pass by const ref - so not passed by value, so no copy of the passed argument undertaken. In general unless a copy is required, only POD types (int, char etc) are passed by value - others are...
  6. Replies
    10
    Views
    170

    Re: My simple vector crashes

    I would code it as this which also includes an overload so that the contents of myVec can be displayed:



    #include <iostream>
    #include <initializer_list>
    #include <stdexcept>
    #include...
  7. Replies
    10
    Views
    170

    Re: My simple vector crashes

    OK. There is an ordering error in the initializer list constructor. The order of initialisation must be the same as the order the variables are defined. So you need as you're using sz before it's...
  8. Replies
    10
    Views
    170

    Re: My simple vector crashes

    What os/compiler are you using? This compiles and runs OK with VS2019. I've only added an include for initialiser list.



    #include <iostream>
    #include <stdexcept>
    #include <initializer_list>
    ...
  9. Replies
    13
    Views
    330

    Re: MFC CListCtrl change checkbox color

    [Attachment Link is invalid]
  10. Replies
    6
    Views
    288

    Re: Need to convert an INT to WORD*

    That still gives the compiler warning - as it's just the same as the (WORD*) c-style cast.
  11. Replies
    6
    Views
    288

    Re: Need to convert an INT to WORD*

    You are compiling as 64bit - Compiler warning C4312 - 'type cast': conversion from 'INT' to 'WORD *' of greater size is only issued when trying to assign a 32-bit value to a 64-bit pointer type, for...
  12. Replies
    2
    Views
    131

    Re: stl find_if iterator type

    As a set is sorted, you can't change it's key (value) as that would change the ordering. You need to erase (or extract for C++17) and insert.



    include <iostream>
    #include <algorithm>
    #include...
  13. Re: Removing the duplicates in the multiset (bit urgent)

    Whilst this solution will prevent the non-required duplicate entries, it will have an adverse effect on performance - as the multiset is effectively traversed twice - once to see if the cell doesn't...
  14. Replies
    15
    Views
    540

    Re: __asm equivalent for 64-bit programming

    Sorry, I got my count wrong :blush:

    Offset 28 is MXCSR_MASK

    From the manual page 284:



    This is what mxcsr_mask & (1<<6) is doing. It's testing if bit 6 is set - ie denormals-are-zero mode...
  15. Replies
    15
    Views
    540

    Re: __asm equivalent for 64-bit programming

    OK - so mxcsr_mask is byte 28, which is byte 3 of the MXCSR register (lower 8 bits of the 4 byte MXCSR).

    See...
  16. Replies
    15
    Views
    540

    Re: __asm equivalent for 64-bit programming

    Originally, how is buf/fxbuf used in the code?
  17. Replies
    25
    Views
    850

    Re: Excel Automation Headaches

    The only last thing I can suggest is that you completely un-install ALL office products, make sure that are no folders called OFFICEnn or VBA, and then re-install complete Office.

    PS You might try...
  18. Replies
    15
    Views
    540

    Re: __asm equivalent for 64-bit programming

    Probably this one https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_fxsave which was suggested in my post #4.
  19. Replies
    25
    Views
    850

    Re: Excel Automation Headaches

    Have you got more than one mso.dll/excel.exe files located on your system? perhaps you're using the wrong files?
  20. Replies
    25
    Views
    850

    Re: Excel Automation Headaches

    mso.dll 17/11/2020 00:10 version 14.0.7263.5000
    excel.exe 17/11/2020 0:04 version 14.0.7263.5000
  21. Replies
    25
    Views
    850

    Re: Excel Automation Headaches

    This is a complete program that compiles OK with MS VS2019 for Excel 2010 on Windows 7. This is the basis for all of my Excel automation code. Sorry, I can't try it with Windows 10 as I haven't got...
  22. Thread: LRU cache

    by 2kaud
    Replies
    3
    Views
    188

    Re: LRU cache

    For lru using unordered_map (hash) and list, consider:



    #include <list>
    #include <iostream>
    #include <algorithm>
    #include <unordered_map>

    class LRU {
  23. Replies
    25
    Views
    850

    Re: Excel Automation Headaches

    This is what I use with VS2019 for Excel 2010:



    #import "c:\\Program Files (x86)\\Common Files\\microsoft shared\\OFFICE14\\mso.dll" \
    rename( "RGB", "MSORGB" ) \
    rename(...
  24. Thread: LRU cache

    by 2kaud
    Replies
    3
    Views
    188

    Re: LRU cache

    Basically for a LRU:

    If the item exists, move to top
    If the item does not exist, insert at top. If the size now exceeds max items, remove bottom.

    This can be simply implemented using a list...
  25. Re: challenged problem C++ implementation - homework help (preparing for an interview

    One simple implementation could be:



    #include <vector>
    #include <utility>
    #include <iostream>

    auto makesum(const std::vector<int>& nos, int sum)
    {
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)