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
  • C++ and Artificial Intelligence

    question c++ game-dev learning
    6
    0 Votes
    6 Posts
    0 Views
    S
    There are a few rule-based programming languages that were developed with artificial intelligence in mind, specifically expert systems, starting with Lisp and Prolog. But, other than that, any general purpose language is suitable. C++ is a specifically good choice for applications that involve heavy computing, and that is certainly an ostentatious property of most ML algorithms. There's one particular problem you should watch out for however: memory management. Unlike many newer languages, C++ requires you to manage your memory yourself, and this is a constant source of problems, specifically in complex programs that require a lot of memory - and this definitely includes ML. You should therefore learn about the use of smart pointers and always use those, rather than raw pointers. The sooner you get used to using them, the better: it will save you a ton of headaches in the long run! As an introduction, check the descriptions and articles on C++ sites (e. g. Dynamic memory management - cppreference.com[^]) , or you could find some articles right here, e. g. C++11 Smart Pointers[^] 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)
  • CChildFrame in separate thread

    question
    9
    0 Votes
    9 Posts
    0 Views
    _
    This is a good news. So, I will launch view after view to do a login to see how is moving my GUI ... if I think well, there is some methods on this CHtmlView which reveal that all tasks inside html gui is made somewhere in backside (I guess): CHtmlView::OnBeforeNavigate2 CHtmlView::OnDocumentComplete CHtmlView::OnDownloadBegin CHtmlView::OnDownloadComplete CHtmlView::OnNavigateComplete2 CHtmlView::OnNavigateError CHtmlView::OnUpdateUI // ans so on ...
  • Using fstream with USB Serial Port

    c++ linux help question
    31
    0 Votes
    31 Posts
    2 Views
    J
    That is EGAIN (you can look it up in errno.h and get the corresponding error message with strerror(3) - Linux manual page[^] ) and in most cases (as here) not an error. You are just calling read again too fast (the next character has not been received so far). To avoid this you can set a timeout value. Then the read() will block until data are available or a timeout occured.
  • Global key press [SOLVED]

    question
    11
    0 Votes
    11 Posts
    1 Views
    V
    Ok, thanks!
  • mapping pthread id to custom id

    question c++ help tutorial learning
    5
    0 Votes
    5 Posts
    0 Views
    L
    Quote: whenever each core access the package manager class (and its queue), it do based on the custom id. Why not the real id?
  • How to disable a HTML Input in c#

    csharp html asp-net tutorial
    2
    0 Votes
    2 Posts
    0 Views
    B
    The syntax should be "disabled" not "disable" document.getElementById('testInput').disabled = true; HTML DOM Input Text disabled Property[^] By the way, I think you should had posted this question to Web Development Discussion Boards[^] instead of "C / C++ / MFC" Bryian Tan
  • need COM/DCOM basics

    com
    2
    0 Votes
    2 Posts
    0 Views
    J
    There are several articles on CodeProject, here are links to a few; DCOM D-Mystified: A DCOM Tutorial, Step 1[^] Introduction to COM - What It Is and How to Use It.[^] The Simplest COM Tutorial in Visual Studio 2008[^] DCOM D-Mystified: Questions and Answers[^] COM in plain C[^] "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
  • Mouse Wheel scrolling support for MFC application.

    c++ help tutorial
    8
    0 Votes
    8 Posts
    4 Views
    J
    It is still unclear for which window you want to handle the scrolling. If it is working in the views, all should be fine. Because the views show the content which might be scrolled. The frame windows are parents of the views providing the frame and the caption bar. They did not know about the content of the client area (the view) and can therefore not know how to scroll the content. I suggest to read about about the MFC document view architecture. Some links: Document-View Architecture[^] Multiple Document Types, Views, and Frame Windows[^] Frame Windows[^] Relationships Among MFC Objects[^]
  • Changing Display gamma [SOLVED]

    tutorial question
    10
    0 Votes
    10 Posts
    0 Views
    V
    Thanks for you help!
  • OnDeviceChange dbcc_name length

    question
    10
    0 Votes
    10 Posts
    4 Views
    U
    Thanks for the tip. You've been very helpful.
  • Object pointer as method argument

    debugging question
    6
    0 Votes
    6 Posts
    1 Views
    _
    I used double pointer and goes perfectly. Kindly thank you all of you (including Richard)!
  • Which do I use ide for learn c ++

    visual-studio question
    5
    0 Votes
    5 Posts
    0 Views
    CPalliniC
    I am young enough to continue using vim. :-D
  • MFC Static Library Project

    c++ visual-studio question
    3
    0 Votes
    3 Posts
    0 Views
    Richard Andrew x64R
    Thank you for your response! I just figured out how to do it. First, create a static library project, then include all of the MFC headers in the stdafx.h file. Thanks again. :) The difficult we do right away... ...the impossible takes slightly longer.
  • free pointer to pointer

    tutorial
    9
    0 Votes
    9 Posts
    0 Views
    CPalliniC
    OMG, Rugby! :thumbsup:
  • 0 Votes
    2 Posts
    0 Views
    L
    This is not a service that this site provides, please see HOW TO ASK A QUESTION - C / C++ / MFC Discussion Boards[^]. If you want help with some code then you need to show the code and explain what is wrong with it.
  • IHTMLElement click

    html debugging question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • How to call a 'C' program function from VB code ?

    tutorial question
    8
    0 Votes
    8 Posts
    2 Views
    _
    :laugh: «_Superman_»  _I love work. It gives me something to do between weekends. _Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C
  • #import <somedll.dll> no_namespace

    question
    4
    0 Votes
    4 Posts
    2 Views
    _
    This is a COM (Component Object Model) thing. Basically the COM runtime takes type library information embedded in the COM DLL and creates headers and helper methods including some exception handling so that client C++ programs can call into the DLL. «_Superman_»  _I love work. It gives me something to do between weekends. _Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C
  • event handler

    3
    0 Votes
    3 Posts
    0 Views
    _
    There are some great articles here on CodeProject - Tree Controls[^] Be sure to pick the ones written in C++. «_Superman_»  _I love work. It gives me something to do between weekends. _Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C
  • Custome title bar

    tutorial
    4
    0 Votes
    4 Posts
    1 Views
    _
    The most basic thing to do for your need is to handle the WM_NCHITTEST[^] message. The LPARAM parameter gives you the mouse coordinates on your window and then you figure out if it is over your customized title bar and return HTCAPTION from the message handler. You may also want to check when to return HTCLOSE, HTMAXBUTTON, HTMINBUTTON, HTSYSMENU etc. «_Superman_»  _I love work. It gives me something to do between weekends. _Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C