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
  • MFC Top Level menu position.

    design csharp c++ visual-studio question
    2
    0 Votes
    2 Posts
    0 Views
    L
    You can do it with raw Windows API but as MFC is only on maintenance it likely will never be available in MFC unless you do it yourself. In vino veritas
  • 0 Votes
    10 Posts
    0 Views
    Z
    Hi, Thanks for your good intentions and for correcting my code through defensive programming techniques. I was missing you. I am not getting correct results. C++ code is giving correct results. I would take up this problem again but I have to complete the assigned task first. Wish you all the best. Zulfi.
  • Image display problem in listcontrol

    visual-studio csharp c++ debugging help
    4
    0 Votes
    4 Posts
    1 Views
    V
    You are welcome! :)
  • Conversion from- C++ to C-language

    tutorial c++ graphics question
    5
    0 Votes
    5 Posts
    0 Views
    L
    There is one slight difference which may or may not be important in some situations. C++ new usually zeros the allocated memory In C you can use calloc for that it has the format void *calloc(size_t nitems, size_t size) So you can actually remove the multiply because you have the number of items and the size of each item send_buffer = (double *)calloc(num_rows, sizeof(double)); Now it allocates and zeros the allocation. In vino veritas
  • processing Multithread in MFC

    c++ help
    3
    0 Votes
    3 Posts
    0 Views
    L
    Quote: The purpose of this Task is to let you express your problem-solving skills, programing skills, as well as to reveal your style of coding. The question is clear, it is to test your skills, not the skills of some strangers on the internet. Show what you have tried, explain what you are having a problem with, and people will try to help you. But no one is going to do your work for you.
  • Where do you place your #includes?

    json c++ regex performance help
    11
    0 Votes
    11 Posts
    1 Views
    K
    No Problem at all: #ifndef HEADER_XY #include 'HEADER_XY.H' #endif In HEADER_XY.H must - of course - written been #define HEADER_XY
  • Preprocessor Directives in C Program

    question
    9
    0 Votes
    9 Posts
    0 Views
    L
    As k5054 says, the #include is a preprocessor directive. But, even worse, it contains a plethora of other directives.
  • Vector of Class with Array

    graphics data-structures help
    11
    0 Votes
    11 Posts
    0 Views
    L
    This looks weird. I normally use min / max as a "limiter". Are the angles always valid? if (anglemaxangle) maxangle=angle; "(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal
  • The GOD

    json tutorial
    2
    0 Votes
    2 Posts
    0 Views
    L
    Those are 3 white papers, not "questions". "(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal
  • Popularity Of C among developer

    question
    31
    0 Votes
    31 Posts
    1 Views
    J
    Yes I did the same thing. The header file did not expose the structure. It was defined in the source file and allocated/managed by the methods. Not sure if I typedef'd a handle for the void pointer or just passed the void pointer directly.
  • Concept of namespace

    question
    7
    0 Votes
    7 Posts
    0 Views
    J
    Just to be clear namespaces should not be considered a limitation or a feature that is used to protect the scope of variables. Rather it should be considered as a way to protect other entities like classes and methods. If you have a problem with namespace collision in scopes with variables then you need to refactor your code so variables are not exposed at all.
  • Get menu color in MFC feature pack

    question c++ help tutorial
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • New [[nodiscard]] attribute usage.

    question
    7
    0 Votes
    7 Posts
    0 Views
    R
    John R. Shaw wrote: ... same programmers also tend to ignore warnings. But, but, if it compiles, I'd then not need to worry about the warnings, right?!
  • "Debug Assertion Failed at line: 252 in viewcore.CPP"

    debugging help c++
    3
    0 Votes
    3 Posts
    0 Views
    D
    manoharbalu wrote: The problem is when I click on the view...I have added the below code for selection of tabs. But what does the code look like that responds to the view being clicked? "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
    0 Views
    V
    Try to log: at first step log the main steps of the running application, then implement smaller logging steps and so on...
  • 0 Votes
    5 Posts
    0 Views
    S
    @1) he doesn't have a getter and setter for book::author ;-) @2) agreed. Either the class author should really be a class author_reference, and name and email are just a (n unsuitable) choice of a unique reference to this specific author which is represented within a separate class and my contain more (private) data like home address and preferred brand of peanut butter. Or the class author really represents an actual author, in which case (s)he should only be referenced, not defined as a data member. After all, the author shouldn't die just because a book is burned... :omg: GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
  • i really need help with this

    learning data-structures help
    11
    0 Votes
    11 Posts
    0 Views
    M
    it was a cat
  • Combination or inheritance

    oop tutorial question
    3
    0 Votes
    3 Posts
    0 Views
    D
    元昊 潘 wrote: ...should the Distance class be inherited from the Point class or an object of the Point class as a data member of the Distance class? Is a vs. Has a "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
  • triplet or what ?

    linux question
    10
    0 Votes
    10 Posts
    0 Views
    L
    If your coming thru a makefile you can pick the compiler OS inside the makefile I always do it because I need to swing between RM and DEL and the directory slash in the makefile You can change the compiler binary in that conditional as well. ifeq ($(OS), Windows_NT) #WINDOWS USE THESE DEFINITIONS RM = -del /q /f SLASH = \\ else #LINUX USE THESE DEFINITIONS RM = -rm -f SLASH = / endif So ...... ifeq ($(OS), Windows_NT) #WINDOWS USE THESE DEFINITIONS RM = -del /q /f SLASH = \\ CC = arm-none-eabi- else #LINUX USE THESE DEFINITIONS RM = -rm -f SLASH = / CC = arm-linux-gnueabi- endif In vino veritas
  • Putting declared const into a print statement

    html
    6
    0 Votes
    6 Posts
    0 Views
    S
    Frankly, I had forgotten the concatenation example you show. As for your escaped quotes, yes, I was referring to the use of the \ to allow the explicit use of the the following ". I thought that since the contents of the print statement were already delineated by leading and trailing quotes, that I had to use the \ to permit the use of additional quotes between those two "bookend" quotes. Thanks for setting me straight. Its been a good day - I learned something. Thank you!!