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
  • Travel salesmen Problem in C or C++

    help c++
    6
    0 Votes
    6 Posts
    0 Views
    Z
    No, no one will write all the code for you. However, we would happily help you if you showed us where you were stuck. There are only 10 types of people in the world, those who understand binary and those who don't.
  • 0 Votes
    10 Posts
    0 Views
    G
    I found out the problem. I passed the size of the wide-char buffer in bytes to mbstowcs_s rather than the size in WORDS. Immediately I corrected this, everything started working fine. Thanks a lot.
  • MFCShellTree: I want to see even files

    help question
    2
    0 Votes
    2 Posts
    0 Views
    D
    This is not an Italian board. Speak type English, please. "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
  • Device Context Origin [SOLVED]

    question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • C/C++ files with "Ex" suffixes

    c++ question announcement
    5
    0 Votes
    5 Posts
    0 Views
    D
    thank you very much. i had to name something where it was in appropriate to overload, and I couldn't think of an appropriate name. i saw something in microsoft's thread or mutex library that used that naming convention. I should have realized Ex meant "extended", duh. Kind regards, :java:
  • 0 Votes
    3 Posts
    0 Views
    M
    Excellent !!! plug the code right in and works nearly ok; I have some minoe redraw issue that should be easy to track down. :thumbsup: Thanks. I'd rather be phishing!
  • A simple question about Static Controls

    help question c++ json
    5
    0 Votes
    5 Posts
    0 Views
    T
    Thank you both Superman and Richard ... now the Static appears correctly ...:thumbsup:
  • how to replace \n with alt+enter while exporting to .CSV

    help tutorial question
    2
    0 Votes
    2 Posts
    0 Views
    J
    Let the line feed in place and enclose the cell content by double quotes. This should be accepted by Excel when rows are terminated by carriage return - line feed pairs. So your CSV file should look like: Row1:Col1, "Row1:Col2\n with new line"\r\n Row2:Col1, "Row2:Col2, with comma"\r\n Row3:Col1, "Row3:Col2 with "" esacped quote"\r\n Row4:Col1, " Row4:Col2 begins and/or ends with space "\r\n As an alternative you may write HTML files using tables. These can be also imported by Excel.
  • Variable in flash memory - how to write?

    adobe business performance tutorial question
    5
    0 Votes
    5 Posts
    11 Views
    E
    Thanks, that clears it up!
  • NM_CUSTOMDRAW in an ATL dialog based application

    c++ help question
    2
    0 Votes
    2 Posts
    0 Views
    L
    Are you certain that this works in ATL? According to http://msdn.microsoft.com/en-us/library/eeah46xd.aspx[^], this is only for MFC 4.0.
  • 0 Votes
    5 Posts
    0 Views
    J
    You're right. It's already been posted there now. Thanks
  • add file version to a new text file

    question announcement
    13
    0 Votes
    13 Posts
    0 Views
    D
    To my knowledge, text files do not meta data, which is where you would store things like company name, author, version, etc. For text files, the file system keeps track of simple things like date, time, and attributes. "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
    13 Posts
    0 Views
    U
    Thank you, I have solved this problem.
  • MFC Grid Control does not show cells content

    help c++ css
    2
    0 Votes
    2 Posts
    0 Views
    S
    Normally we would tell you to post this question in the forum at the bottom of the article: MFC Grid control 2.27[^], but I think it is ok for you to post it here as well. Although Chris is around all the time, he is obviously very busy so there is no guarantee he is able to answer your question. It is a very old project by now (it is article #8 here on CodeProject!), but I see that Chris did update it not too long ago. In your explanation of the problem, you need to include which version of Windows you are running it on an make sure to mention whether it is 32 or 64 bits. Soren Madsen "When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
  • Print a long CString

    c++ question career
    3
    0 Votes
    3 Posts
    0 Views
    L
    Gagnon Claude wrote: pDC->(TextOut(pt.x, pt.y + j * m_nHautLigne, resToken); That does not really tell us anything useful. You need to show where in your code you check for end of page, and exactly what index values you start with on the second page.
  • GroupBox ScrollBar Is not working

    help
    3
    0 Votes
    3 Posts
    0 Views
    L
    Hi, MFC/Win32 is nothing like VB... you cannot just drop a scrollbar on a dialog/control/window and expect it to scroll the window for you. You need to do all of this yourself. You will need to have the parent window that owns the scrollbar handle the WM_VSCROLL message. You will then need to scroll the window yourself. WM_VSCROLL message[^] CWnd::OnVScroll[^] ScrollWindow function[^] Using Scroll Bars[^] Best Wishes, -David Delaune
  • Printing with a CString

    mcp tutorial question
    4
    0 Votes
    4 Posts
    1 Views
    L
    Hi, Your not really 'printing' but rather painting text using GDI if your utilizing the TextOut function[^]. Sounds like the wm_erasebkgnd handler (or conversely WM_PAINT if you are painting in the erase handler)is overwriting what you painted. You should share some code. Also recommend reading all of this: Painting and Drawing[^] Best Wishes, -David Delaune
  • CS Data Struct

    data-structures
    3
    0 Votes
    3 Posts
    0 Views
    CPalliniC
    Quote: I started it off as so #include using namespace std; struct studenttype Well, it looks promising. THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?! -- C++ FQA Lite
  • MFC app - "Encountered an improper argument"

    c++ help visual-studio csharp sysadmin
    5
    0 Votes
    5 Posts
    2 Views
    U
    Thank you, I amended dwFlags to "OFN_ENABLESIZING | OFN_HIDEREADONLY", which even make more sense (having multiselect on saving a file dialog doesn't make much sense) and it works on both XP and 2008 server.
  • 0 Votes
    7 Posts
    0 Views
    T
    Be careful, you are heavingly doing copy of your objects. You should pass T& when you add the object and return T& when you retrieve them. I would also suggest to have a const version of your accessor, returning 'const T&'.