Skip to content

C / C++ / MFC

C, Visual C++ and MFC discussions

This category can be followed from the open social web via the handle c-c-mfc@forum.codeproject.com

111.5k Topics 465.7k Posts
  • 0 Votes
    2 Posts
    5 Views
    D
    The (incomplete) for() loop looks a bit odd in that it is using the same values for the header and footer and the set methods are called twice. If you are wanting the header/footer on the even pages to be different than the header/footer on the odd pages then you are going to have to check whether l is odd or even and use a different value accordingly. "One man's wage rise is another man's price increase." - Harold Wilson "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
  • Visual C++ 2022 cout bug?

    help c++ testing debugging beta-testing
    17
    0 Votes
    17 Posts
    34 Views
    S
    It looks like nobody is encountering this issue except me. Thanks again. You can stop testing.
  • 0 Votes
    15 Posts
    23 Views
    OriginalGriffO
    You seem to be under the impression that everybody here is both out to get you and here to do your work for you: neither is the case. Unfortunately for you everybody here is a volunteer, and most do not take kindly to having their time wasted and abuse HURLED at them and respond in an appropriate manner. I hope that you can take your time here as a learning experience, but from your question and comment history, I guess that is unlikely. If this has been your attitude on the "other sites" that threw you off as well, I can understand why they didn't want you around either ... "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
  • Playing an mp3 file using MCI

    question c++ tutorial
    3
    0 Votes
    3 Posts
    5 Views
    D
    Well, all of the Windows-supported libraries present problems, especially if one is building using MinGW rather than Visual C++. Generally, they cannot be built at all without a massive amount of hacking the code bases to make them MinGW-compatible. No DirectShow apps will build, neither will the more-recent MS audio interface (don't recall the name at the moment). However, I found a freeware library called zplay, which is easy to build, open source, and nice, compact code... it also has the ability to play other formats, such as flac... so I'll just go with that... libZPlay multimedia library (Win32)[^]
  • C++ for loop syntax ?

    c++ question
    9
    0 Votes
    9 Posts
    15 Views
    J
    No idea why your question was down voted. So I up voted it. Sometimes I can guess at skill level so it helps to frame an answer but I am unsure of your skill level. (I am using 'skill' intentionally in a very ambiguous way here.) Do you understand what the following loop construct does? for (int i = 1; i <= 5; ++i) If you do not then I suggest that you experiment with that for a while. And look up different ways to structure it including replacing it with a while loop. The structure that you asked about is just syntactic sugar that ends up implementing something similar to the above. So understanding it first helps.
  • Upgrade my skills...

    c++ help question
    8
    0 Votes
    8 Posts
    25 Views
    L
    Ha ha, join the club!
  • Title bar display and closing problem

    help c++ game-dev linux tutorial
    3
    0 Votes
    3 Posts
    7 Views
    J
    Ok. I'll post it in SFML forum.
  • Trace a CString

    debugging html question
    7
    0 Votes
    7 Posts
    13 Views
    T
    Thanks - I've been looking for a few days for this solution. Works a treat
  • Creating a pointer and asigning a variable address to it

    performance question
    7
    0 Votes
    7 Posts
    13 Views
    CPalliniC
    Amen to this. "In testa che avete, Signor di Ceprano?" -- Rigoletto
  • How to implement "\n" in QT QDebug class

    tutorial c++ debugging question
    4
    0 Votes
    4 Posts
    17 Views
    L
    Member 14968771 wrote: ..RTFM.. everybody knows that..." disease. What a pity you seem immune to it.
  • 0 Votes
    18 Posts
    22 Views
    C
    I've managed to get SharpDX to play a video from a file without problems, and also have been able to do my 2D drawing. This was simple enough and the performance is good on Speed Test - TestMySpeed[^] .
  • Accelerate Your Academic Growth with the Best Assignment Experts

    com help
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • cleaners near me

    com
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • 0 Votes
    5 Posts
    10 Views
    D
    There is no standard way of doing that. The data backing the owner-draw can be stored any way the application needs. It can be, literally, stored anywhere, in any format, with no public API to get at it. Think of how you store data in your own applications. Do you expose that data in standardized ways across all of your applications? Do you expose that data in a public API? Of course not! Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles. Dave Kreskowiak
  • c++

    question c++
    6
    0 Votes
    6 Posts
    3 Views
    L
    It's almost word for word the same as the previous two. And suspicously similar wording to Change the window caption color[^]
  • Snooker Game programing using c Programing.

    game-dev help question
    5
    0 Votes
    5 Posts
    13 Views
    D
    Depending on the environment, basic real-time programming and multithreading may also be required. Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.
  • Socket or file descriptor ?

    question help
    6
    0 Votes
    6 Posts
    4 Views
    K
    Unless you're hacking on glibc, you really shouldn't be digging around in the system include files. Nevertheless, doing some googling around I learned this: k5054@localhost]$ cpp -include stdlib.h -dM /dev/null | grep -E 'define __(THROW|LEAF)\>' #define __LEAF , __leaf__ #define __THROW __attribute__ ((__nothrow__ __LEAF)) [k5054@localhost]$ That means that the __THROW notation adds the attributes nothrow and leaf to the definition of the function. You can read up on them here:[Function Attributes - Using the GNU Compiler Collection (GCC)](https://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/Function-Attributes.html) Surely by now you know how to handle libc errors: #include #include int ret = socket(foo, bar, baz); // socket() returns -1 on error and sets global var errno if(ret == -1 ) { switch (errno) { case EACCES: // handle EACCES issue break; // etc. default: // print out the text associated with the error using strerror() std::cerr << "socket() returned error " << strerror(errno) << '\n'; } } Note: It is perfectly possible for errno to be set by a system call, even when the system call is successful. That can happen when the system call itself makes another system call, which sets errno. I ran into this not so long ago with code like: errno = 0; ret = somefn(blah, blah, blah); if (errno) { // do stuff } In this case somefn() called otherfn() to do its work. otherfn() failed, setting errno in the process, and then somfn handled the error, and perhaps called anotherfn() which succeded, but did not set errno back to zero. Moral of the story: you need to check if your system call returned an error (normally -1, but not neccesarily), and then check the value of errno. Keep Calm and Carry On
  • 0 Votes
    6 Posts
    3 Views
    C
    Dusting this gripe off and putting it to bed. For a certainty, VS2008 creates project files on a per system and person basis. It is what it is. After multiple occurrences of having to slog through this nonsense, I finally came across the Import and Export Settings Wizard. Go to Tools -> Import Export and follow the steps. I have yet to find any documentation from Microsoft that starts with "So, you're moving to a new machine..." Charlie Gilley “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759 Has never been more appropriate.
  • 0 Votes
    3 Posts
    2 Views
    L
    Normalize the angle to <= 90 (right angle triangle); calculate the opposite and adjacent sides; offset origin x by (int) adjacent, and origin y by (int) opposite. "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
  • 0 Votes
    4 Posts
    9 Views
    A
    C uses malloc and free for memory allocation while C++ uses new and delete for memory allocation. C does not provide direct support for error handling, while C++ supports exception handling that helps in error detection and smooth handling