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
  • pointers to functions

    question announcement lounge
    12
    0 Votes
    12 Posts
    17 Views
    L
    Not quite, I started in the transistor age, so things were getting quite sophisticated.
  • Convert decimal to binary in C

    help
    8
    0 Votes
    8 Posts
    14 Views
    L
    You have updated your question, but it is not clear what has changed since yesterday when we gave you the answer.
  • right-aligned shortcuts in popup menu

    question
    7
    0 Votes
    7 Posts
    24 Views
    U
    ...also sorry if I got your first & last names confused... I think I did. Sorry!
  • VC++/MFC

    c++ tutorial
    8
    0 Votes
    8 Posts
    23 Views
    V
    To create "a button or checkbox dynamically on MFC ... window" you do the following steps: 1. create a variable of the CButton class 2. Call CButton::Create method to create a button or checkbox window. That's all. You only need to read the Microsoft Docs and know the exact size and position of your button within the parent (dialog or form view or some other) window.
  • How do I add listboxes to a back buffer and use that?

    csharp c++ question wpf tools
    32
    0 Votes
    32 Posts
    85 Views
    M
    Does someone here know how to put a text box or a list box to a back buffer? Should he have looked more into blitting it there? The discussion is valuable. I liked reading it and learning from it, but I think that he still has the problem of putting the list or text box to a buffer. Please someone help this guy and I will try to learn from this also. Thank you.
  • 0 Votes
    11 Posts
    15 Views
    J
    The first thing that pops into my head is to force the EXE and DLL to make their initial framework calls from separate threads and have the framework use a named mutex. Not elegant spawning a thread just to make a single function call and immediately waiting for that thread to finish, but it would work. Be wary of strong drink. It can make you shoot at tax collectors - and miss. Lazarus Long, "Time Enough For Love" by Robert A. Heinlein
  • Prey/predator c++ project

    c++ css help
    3
    0 Votes
    3 Posts
    11 Views
    Greg UtasG
    If the size of the grid is static (m x n), you can just hard-code it: enum GridOccupant {EMPTY, PREY, PREDATOR}; GridOccupant Grid[m][n] = {EMPTY}; If the grid is dynamic, the question is whether you're allowed to use things from the Standard Template Library (STL), like std::vector[^], or whether you're supposed to allocate the memory yourself. When the user specifies the location of Prey or Predator, you create one and add it to PreyAnimals or PredatorAnimals. Again, the question is whether you're allowed to use the STL. Each Animal (the base class for Prey and Predator, if this helps your design) keeps track of its location in the Grid to make it easy to find. You might discover that you don't need Grid at all, only its dimensions (m x n). Robust Services Core | Software Techniques for Lemmings | Articles The fox knows many things, but the hedgehog knows one big thing.
  • how to start QProcess not coding argument parameter ?

    tutorial question
    3
    0 Votes
    3 Posts
    9 Views
    J
    Member 14968771 wrote: DELETED SOLVED Deleted, really? :thumbsdown: So no one in the future might learn? "the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
  • 0 Votes
    9 Posts
    13 Views
    D
    Why are you not using the registry API directly rather than going through (antiquated) system() calls? "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
  • 0 Votes
    4 Posts
    8 Views
    D
    sahil Ranka wrote: Is there a good method for making a FILE * that simply focuses to an area in memory rather than on a disk? Is mmap() of any value here? "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
  • Convert curl request

    json c++ question learning
    13
    0 Votes
    13 Posts
    6 Views
    _
    Yes, that seems to work. Thank you all of you !
  • 0 Votes
    4 Posts
    6 Views
    CPalliniC
    Both of the previous answers are correct. On my machine, with VS2019, this code static void Main(string[] args) { Stopwatch sw = new Stopwatch(); double result=0.0; sw.Start(); { for (int i = 1; i < 100000000; i++) { result += Math.Sin((i \* 25.0) / i \* i); } } sw.Stop(); Console.WriteLine(sw.ElapsedMilliseconds.ToString()); Console.WriteLine(string.Format("{0}",result)); } produces 4739 -7,98150964297362 While the following int main() { int start = clock(); double result = 0.0; for (size_t i = 1; i < 100000000; i++) { result += sin((i * 25.0) / i * i); } int end = clock();//Now check what amount of ticks we have now. //To get the time, just subtract start from end, and divide by CLOCKS_PER_SEC. std::cout << (1000.0 * (end - start) / CLOCKS_PER_SEC) << "\n"; std::cout << result << "\n"; } outputs 4153 -7.98151 "In testa che avete, Signor di Ceprano?" -- Rigoletto
  • image background datagrid

    tutorial
    3
    0 Votes
    3 Posts
    7 Views
    L
    Anything not in the foreground, is considered as being in the background. "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
  • File IO library

    5
    0 Votes
    5 Posts
    11 Views
    C
    thanks Greg, I find that useful feedback
  • hello guy my name is SARORN can i ask you about any inform?

    question
    4
    0 Votes
    4 Posts
    14 Views
    R
    Well, aside from asking this exact question again (ok, you might ask it again to assert that VN and/or K5 is/are NOT robots I guess), use keywords in your PROGRAM by typing them into the "search" here at CP. The Discussions are titled and the QA is tagged. So keep those two things in mind also. And. Have a great day!
  • c++

    c++
    9
    0 Votes
    9 Posts
    11 Views
    L
    The two functions checkSquareNumber and squareNumber should both start their calculations at 2, rather than 0. For square roots, zero is meaningless and 1 is the square root of itself.
  • c++

    data-structures c++ design
    2
    0 Votes
    2 Posts
    4 Views
    CPalliniC
    And... What's the problem? Count the connections of each node. "In testa che avete, Signor di Ceprano?" -- Rigoletto
  • parsing interactive text

    json
    6
    0 Votes
    6 Posts
    9 Views
    L
    First hit from: C++ string split - Google Search[^] : parsing - Parse (split) a string in C++ using string delimiter (standard C++) - Stack Overflow[^]
  • Loading DLL from file not PATH

    help java c++ com debugging
    28
    0 Votes
    28 Posts
    74 Views
    V
    I don't see any link it might have been cut, or it is hidden, but this is an old email I have that I don't care about spam so it is fine to make it public: Email removed
  • 0 Votes
    1 Posts
    2 Views
    No one has replied