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
  • memory allocation error

    help c++ graphics algorithms performance
    6
    0 Votes
    6 Posts
    0 Views
    S
    1. Always post the code that you actually use and that shows the described (problematic) behaviour 2. Cleaning up your code can occasionally help, but if you do so, then (a) make sure the clean code still compiles (and runs) to the extent the original code did, and (b) make sure the code still shows the same issue(s)! There really is no point discussing code that doesn't show the behaviour you are describing. 3. Learn to use a debugger, step through your code, and examine the current value of your local variables. Since you already know where you're crashing, it's a good starting point to set a break point before the call to push_back(), and investigate the state of your variables then. Bonus tip: remove that line using namespace std; It is a crutch and will make it more difficult to spot issues in your code. You'll need to add the prefix std:: in many places, so that requires additional typing, but it really isn't that hard, and it adds to the readability of your code as well as reducing the likelyhood that you're mixing up local and library symbols! The extra effort of always typing std:: pays off very quickly! If you don't believe me, the warnings are all over the place right in the C++ reference. See for example http://en.cppreference.com/w/cpp/language/namespace#Using-directives[^]: cppreference.com wrote: Using-directive does not add any names to the declarative region in which it appears (unlike the using-declaration), and thus does not prevent identical names from being declared. and cppreference.com wrote: The using-directive using namespace std; at any namespace scope introduces every name from the namespace std into the global namespace (since the global namespace is the nearest namespace that contains both std and any user-declared namespace), which may lead to undesirable name collisions. This, and other using directives are generally considered bad practice at file scope of a header file. Emphasis mine. 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 arc
  • Calling a URL from an MFC - MDI application

    c++ question
    3
    0 Votes
    3 Posts
    0 Views
    D
    Member 12108486 wrote: As per my knowledge, this need IE browser right? CHtmlView doesn't need a browser, it is the browser. "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
  • Why my TreeView cannot show icon

    c++ database help question
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • VS 2010 C++ Debug

    c++ visual-studio debugging help question
    2
    0 Votes
    2 Posts
    0 Views
    Richard Andrew x64R
    The code that attempts to use this function must have admin rights. The difficult we do right away... ...the impossible takes slightly longer.
  • 0 Votes
    9 Posts
    0 Views
    D
    Member 8534035 wrote: ...the tabulator is ignored completely. Of course, since it was not meant to handle it as a special case. One solution would be to call AfxExtractSubString() to break your source string up into its individual tokens. Then you could call InsertItem() to insert an item in the list control, followed by SetItemText() to set the text of subitems. "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
    U
    I had the same problem using a CMFCPropertyGridCtrl in a CPropertyPage with VS2012 (without Touch Screen). Using the resouce in a CDialog is no problem, but when used in a CpropertyPage,the page calls OnDestroy as soon as it should be initialized. The Solution was, dont include the CMFCPropertyGridCtrl aus a resource control and dynamically create it after the InitDialog of the CProperyPage is called. CMFCPropertyGridCtrl * pctrlPropertyGrid = new CMFCPropertyGridCtrl(); if (pctrlPropertyGrid) { CRect rect; GetWindowRect(&rect); ScreenToClient(&rect); rect.DeflateRect(5, 10, 5, 10); pctrlPropertyGrid->Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER, rect, this, IDC_MFCPROPERTYGRID1); ... }
  • converting sound to text software from c++

    c++ question
    2
    0 Votes
    2 Posts
    0 Views
    L
    See https://msdn.microsoft.com/en-us/library/ee125077(v=vs.85).aspx[^].
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • Kinect V2 (Angle detection between 2 joints)

    csharp c++ visual-studio help
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • How to make a Windows service to manage SQLite DB

    database help sqlite sysadmin linux
    14
    0 Votes
    14 Posts
    0 Views
    J
    intelstar venus wrote: The problem was in using bad logger function. In general that should never happen. A good logger should not normally impact an application if the logger fails.
  • socket:send integer

    sysadmin question help career
    6
    0 Votes
    6 Posts
    0 Views
    L
    So what is the problem?
  • Change menu item text

    question
    6
    0 Votes
    6 Posts
    0 Views
    L
    It is difficult to guess what may be happening in your code, but changing the text of a control should have no effect on the message passing and event handling for that control. I would try it myself but do not have MFC on my system. There is also some useful information at https://msdn.microsoft.com/en-us/library/65dtx4a4.aspx[^].
  • 비비카지노☀☇ SOK800.COM ☇☀비비카지노

    com
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 스타카지노☀☇ SOK800.COM ☇☀스타카지노

    com
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 카지노복합리조트˚™˚NGP7。COM˚™˚카지노복합리조트

    com
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 코리아카지노˚℡˚UPK9。COM˚℡˚코리아카지노

    com
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 아시안카지노˚™˚NGP7。COM˚™˚아시안카지노

    com
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 아시안카지노˚℡˚UPK9。COM˚℡˚아시안카지노

    com
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 코리아카지노˚™˚NGP7。COM˚™˚코리아카지노

    com
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 아시안카지노˚§˚NGP7。COM˚§˚아시안카지노

    com
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied