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: How to capture the screen of a window that contains transparency?

    @c7aesa7r - It is good etiquette to indicate where else it has been posted. This enables any potential reply-er to find out what has already been suggested before spending time replying or looking...
  2. Re: How to capture the screen of a window that contains transparency?

    [Also here http://www.cplusplus.com/forum/general/281832/ ]
  3. Replies
    11
    Views
    1,102

    Re: casting pointer to template type

    ...but you're indexing rfp.pfOut via iOutIndex as if it's an array...
  4. Replies
    11
    Views
    1,102

    Re: casting pointer to template type

    That just says that the pfOut pointer is set to nullptr - ie set to 0 ie not used/specified. Hence the test:



    if ( rfp.pfOut )


    which checks for the nullptr condition.
  5. Replies
    11
    Views
    1,102

    Re: casting pointer to template type

    Simply, rfp.pfOut is a pointer to a float (val) which is a single variable and not an array. But you are treating rtp.pfOut as if it's an array pointer whn it's not. Hence the issue.
    ...
  6. Replies
    11
    Views
    1,102

    Re: casting pointer to template type

    Note though, that this isn't consider 'good practice'. Usually reinterpret_cast highlights some design issue and such code is often considered 'flakey' and 'fragile'. Use at own risk!
  7. Replies
    11
    Views
    1,102

    Re: casting pointer to template type

    You can't use static_cast on pointers. Use reinterpret_cast.
  8. Replies
    14
    Views
    1,029

    Re: New file inclusion problem on legacy code

    Have you considered using std:: optional? There is also a nullopt value. https://en.cppreference.com/w/cpp/utility/optional

    If not that, then perhaps return say a std:: pair - one element value,...
  9. Replies
    14
    Views
    1,029

    Re: New file inclusion problem on legacy code

    Well FWAInfo.h must have an include which then includes FWAInfo.h somewhere or another already included file - causing the circular dependency. You''ll need to find what in FWAInfo,h is causing the...
  10. Re: why i can't create a memory HBitmap and draw it?

    [Also asked and answered here http://www.cplusplus.com/forum/general/281591/ ]
  11. Replies
    14
    Views
    1,029

    Re: New file inclusion problem on legacy code

    Yes I know - but I don't know of any. We have a tool which shows the #include hierarchy - but not what each include defines.
  12. Replies
    14
    Views
    1,029

    Re: New file inclusion problem on legacy code

    Yeah - use a pen and paper and work through the includes!

    Seriously, you need to work through the includes/code, find each of the different defined types (classes/structs etc), note their name...
  13. Replies
    14
    Views
    1,029

    Re: New file inclusion problem on legacy code

    Well that is fairly easy to determine by finding out the include dependencies for each .cpp/.h file uses. Once you have that, then you can ascertain if there any circular dependencies and which .h...
  14. Re: Occcont.cpp error when migrating old VS2005 application to Visual Studio

    I suggest you create a new solution/project in VS2022 and add the required .cpp/.h et al files, set this solution/project properties as required and then compile. You shouldn't then have any...
  15. Replies
    4
    Views
    742

    Re: ifstream and nulls

    You could read it into a std::string as std::string can contain nulls. Something like:



    std::ifstream ifs;
    std::string buf(2048, 0);

    ifs.open(m_FilePath, std::ifstream::in |...
  16. Replies
    4
    Views
    742

    Re: ifstream and nulls

    buf is sized at 2048, but 20481 chars are tried to be read??
  17. Re: How to "FormatMessage()" my "WSAGetLastError()"

    Well it seems to! eg WSA error code WSAEDESTADDRREQ (10039) is "Destination required"

    if you use 10039 in my code above, it shows:

    A required address was omitted from an operation on a socket....
  18. Re: How to "FormatMessage()" my "WSAGetLastError()"

    This is what I used when I did Windows programming:



    #define WIN32_LEAN_AND_MEAN
    #define NOMINMAX
    #include <windows.h>

    #include <string>
    #include <iostream>
  19. Replies
    5
    Views
    1,386

    Re: Generate test cases

    You might find this article of interest
    http://alexott.net/en/cpp/CppTestingIntro.html
  20. Replies
    6
    Views
    2,088

    Re: Sudden problem with std::vector

    For a constexpr function to return a constexpr value, any functions it calls must also be marked as constexpr. ie. can be evaluated at compile time. Unfortunately, sqrt() isn't one of them.

    See...
  21. Replies
    3
    Views
    7,762

    Re: Pascal to c++ translator

    The above is Pascal. Is there a c++ question somewhere in this?

    If you want this translated to c++, it's not that different. var in a function parameter means 'pass by ref'. lo,,hi for an array...
  22. Re: Why is my single thread code is faster than my multhread code?

    I don't know Vulcan so can only generalise.

    It is a known fact that multi-threaded code can be slower than single-threaded. There are a couple of reasons for this. One is that it takes time to...
  23. Re: Is it safe to locally use arrays, vectors and calloc when multi-threading

    The current version is VS 2022 which provides support for C++20. The Community version is still free. I suggest you install VS2022. This will happily co-exist with VS2017. It uses the same installer.
  24. Re: Is it safe to locally use arrays, vectors and calloc when multi-threading

    Yes.

    Although in C++ programs you should use new/delete rather than calloc/malloc/free
  25. Thread: Tutorials

    by 2kaud
    Replies
    8
    Views
    612

    Re: Tutorials

    Sorry, no. I have no knowledge of that book. But from it's contents it looks just like a C++ intro book.
Results 1 to 25 of 2000
Page 1 of 80 1 2 3 4





Click Here to Expand Forum to Full Width

Featured