Skip to content
Code Project
CODE PROJECT For Those Who Code

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
  • What are the basic features provide by CCmdTarget??

    question
    4
    0 Votes
    4 Posts
    0 Views
    S
    Thanks.
  • migration from Visual studio 6

    help c++ csharp visual-studio com
    35
    0 Votes
    35 Posts
    0 Views
    S
    Sure, Thanks a lot for responding. I will find out.
  • Which IDE is good for programming in C

    visual-studio help
    3
    0 Votes
    3 Posts
    0 Views
    _
    There are a lot of factors that affect how you choose a suitable IDE. Since you're a beginner, I would suggest an IDE that comes free. As CPallini suggested, I also think Visual Studio is the best IDE on the Windows platform. Here are some links on what other people think - http://www.teamliquid.net/blogs/101999-c-ide[^] http://stackoverflow.com/questions/89275/best-c-ide-or-editor-for-windows[^] http://stackoverflow.com/questions/3764389/best-windows-ide-to-try-out-c-programs[^] Here is some information about the free C compilers that are available - http://cplus.about.com/od/glossary/a/compilers.htm[^] «_Superman_»  _I love work. It gives me something to do between weekends. _Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C
  • 0 Votes
    12 Posts
    13 Views
    CPalliniC
    However, the OP code is C, you know, another programming language. ;) THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?! -- C++ FQA Lite
  • 0 Votes
    6 Posts
    0 Views
    S
    dynamic_cast must be useful in parent child relation of classes. It helps to determine object type in a hierarchy. i.e - class Base{ }; class Derived1:public Base{ void der1Fun(){} }; class Derived2:public Base{ }; int main() { Base *bPtr = new derived1(); //now we want to call a derived1 function let der1Fun() Derived1* dPtr = 0; if( dPtr = dynamic_cast(dPtr) ){ dPtr->der1Fun() } else{ //Display the object is not of derived1 type } return 0; } I think this is why we need dynamic_cast.
  • Object cloning

    question
    5
    0 Votes
    5 Posts
    0 Views
    O
    If you want to use them as function parameters, pass them by reference, not by value. void function1(Person p) { // p is a copy } void function2(Person& p) { // p is a reference to the object passed // in as a parameter, not a copy } If you use shared_ptr, remember that you have to make every Person who will be a parent a shared_ptr, otherwise its child will try to delete it (which it has no right to do) when the last goes out of scope. If you want to create a clone of a Person, and clone its relations, you will need to think hard about lifetime management and ownership. What should happen if you tried to clone father? Should it create a clone of grandfather? That is quite simple to do, but it means father will have to delete its grandfather clone in its destructor. Then what happens if another Person has that grandfather as a parent?
  • 0 Votes
    3 Posts
    2 Views
    S
    Obvious answer...that's why its showing Junk characters in the english OS. :)
  • Import CSV to Access DB.

    csharp c++ database tutorial question
    2
    0 Votes
    2 Posts
    0 Views
    L
    See Using OleDb to Import Text Files (tab, CSV, custom)[^] for reading CSV data with C#.
  • How to consume web service in C++ using REST SDK.?

    c++ csharp visual-studio json help
    2
    0 Votes
    2 Posts
    0 Views
    L
    I don't know what you searched for but https://www.google.com/search?q=How+to+use+a+web+service+in+C%2B%2B+using+REST+SDK[^] returned some good links.
  • treeview ctrl rmb menu question

    question visual-studio
    2
    0 Votes
    2 Posts
    2 Views
    L
    What messages or notifications are you responding to?
  • Not able to find the square of the floating number ...

    lounge
    15
    0 Votes
    15 Posts
    0 Views
    CPalliniC
    How do you compute the squares? This program: #include <stdio.h> int main() { double a [] = { 0.035679, 0.079935, 0.033320, 0.042424, 0.012387 }; double sum, square; int n; sum = 0.0; for (n=0; n<sizeof(a)/sizeof(a[0]); ++n) { square = a[n]*a[n]; sum += square; printf("%g ----> %g\n", a[n], square); } printf("sum of squares: %g\n", sum); return 0; } gives: 0.035679 ----> 0.00127299 0.079935 ----> 0.0063896 0.03332 ----> 0.00111022 0.042424 ----> 0.0017998 0.012387 ----> 0.000153438 sum of squares: 0.0107261 THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?! -- C++ FQA Lite
  • Fortran 4 crash when call Write(*, *)

    help question workspace
    2
    0 Votes
    2 Posts
    0 Views
    D
    Andraw111 wrote: I don't where should I put my Fortran question, so I put it here. Have you tried 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
  • 0 Votes
    5 Posts
    2 Views
    L
    Of course the function works, it is used in List controls all over the world. It is more likely that your code is doing something wrong. For a start you are not checking the return code to see whether it succeeded or not, and if not, why. What is the current value of the index nI, and what is being returned by the call to m_arrayOtherImageFiles.GetAt(nI)? Use your debugger to trace through your code to diagnose the problem.
  • 0 Votes
    2 Posts
    0 Views
    _
    The MFC class corresponding to the listbox control is CListBox. If you look carefully you will find there are 2 different controls - List Box and List Control. «_Superman_»  _I love work. It gives me something to do between weekends. _Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C
  • 0 Votes
    6 Posts
    0 Views
    M
    thank you finally I got it..
  • how to generate text file for a program output?

    tutorial question
    12
    0 Votes
    12 Posts
    0 Views
    CPalliniC
    There is the documentation for the very purpose of learning function (or object) usage: Basic Input/Output at C++ reference[^]. printf at C++ reference[^]. THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?! -- C++ FQA Lite
  • Visual studio 2010 - class wizard

    visual-studio csharp
    2
    0 Votes
    2 Posts
    1 Views
    S
    The .clw file is gone, and, apparently, with it the ability to rebuild it. But maybe you can find some help on MSDN: http://msdn.microsoft.com/en-us/library/6761383e%28v=vs.100%29.aspx[^] Regarding classes not showing, maybe this will help. http://stackoverflow.com/questions/4883229/mfc-vs-2010-class-wizard-doesnt-show-the-class-names-for-the-dialog-boxes[^] 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)
  • 0 Votes
    10 Posts
    0 Views
    M
    thank you ...counted I will kip in mind...
  • Icons are displayed as black squares on remote desktops

    help c++ database graphics
    9
    0 Votes
    9 Posts
    1 Views
    A
    Well, we have to distinguish between published knowledge, unpublished/internal one and achieved by experience one. Writing here we primarly hope to find the third kind... but the first two kinds are welcome, too, of course.
  • 0 Votes
    3 Posts
    0 Views
    P
    Please don't cross-post. How to connect and access SQLite database[^] You'll never get very far if all you do is follow instructions.