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
  • How do you read / use this code?

    question hardware help tutorial
    6
    0 Votes
    6 Posts
    0 Views
    V
    I am not sure why all these tags , but I just want to let the forum know I found a reference. Basically two "features" - attribute and weak / strong function declaration , in my case used by GCC. Yet another neat way to extend K&R creation. Thanks for all the help, I appreciate it. GCC Weak Function Attributes – Valvers[^]
  • Printer Control

    database learning
    18
    0 Votes
    18 Posts
    1 Views
    L
    Hi Bram, well I'm a few years older than you, so in theory I should have more knowledge locked in my brain. But you know what they say about theory and practice. When I said I could open the XPS file, I meant one that I generated here. If you can send me the one you generate I could have a look at it for you. Send me a private email and I can give you an address, or put it up on one of the public staging sites.
  • 0 Votes
    15 Posts
    3 Views
    K
    Hi Leon, I have finally found a solution for my problem; and have edited my original post to reflect this. It's not a mathematical solution, but it works well enough. I just thought I'd give you a heads up since you took an interest:) Thanks again for your input! Keith
  • How to expand all the nodes in 'QuickWatch' window?

    help tutorial question
    5
    0 Votes
    5 Posts
    0 Views
    R
    Instead of expanding all the nodes in quickwatch, you could just export the variable to JSON or XML using this Visual Studio Extension: Object Exporter extension[^]
  • Custom Slider control messages cannot be caught

    c++ help question
    13
    0 Votes
    13 Posts
    0 Views
    L
    Okay so the thing you are trying to make is a Radial Control or sometimes called a radial gauge (although gauge tends to imply display only) Can't you just push out the messages as standard scrollbar messages using PostMessage with the handle being your parent window. I mean in standard native Win32 I would do this if I wanted to FAKE a WM_VSCROLL or WM_HSCROLL lets assume your dial is handle is hwnd and a position pos. HWND myParent = GetParent(hwnd); // Standard API call to get a windows parent PostMessage(myParent, WM_VSCROLL, MAKEWPARAM(SB_THUMBPOSITION, pos), (LPARAM)hwnd); // Standard scrollbar fake message posted to my parent As we are faking it I wouldn't use SendMessage as it might go re-entrant (you post off to the dialog and it posts back and around in circles it would go). I can't see how MFC could get that wrong as there message pump is still using PeekMessage from the standard windows queue. In vino veritas
  • CEdit::SetHighlight

    c++ question
    10
    0 Votes
    10 Posts
    0 Views
    A
    Thanks for the suggestions; ES_NOHIDESEL looks like it will do what I need.
  • Owner Draw Static Control Freezes up application

    graphics help
    21
    0 Votes
    21 Posts
    8 Views
    S
    I'm not a huge fan of MFC but have used it extensively in the past. I never had trouble mixing Win32 and MFC at all, in fact I found doing so essential and just part of a regular day MFCing. Steve
  • C fread to read 512k binary file

    help question
    10
    0 Votes
    10 Posts
    11 Views
    F
    thank you for reply , but I use C language .
  • Overloading methods with identical content in lot of derived classes

    18
    0 Votes
    18 Posts
    21 Views
    E
    sorry its tricky but: Cc1::M1() is identical to Cc2::M1() ... the only "data" some Mi() uses is the "this" pointer Cc1::M1() { code m1 } Cc2::M1() { code m1 } ... etc.. Cc1::M3() { f_calculate(this); ... } Cc2::M3() { f_calculate(this); ... } ...
  • How to test a synchronization object for lock?

    tutorial question
    2
    0 Votes
    2 Posts
    0 Views
    J
    There would be a solution by getting the lock count from the undocumented _RTL_CRITICAL_SECTION structure. But there should be no reason to do that when using locks as intended (for short periods). For longer periods use other mechanisms like events.
  • C programming

    game-dev help
    5
    0 Votes
    5 Posts
    0 Views
    K
    can i post the entire project so u can look through and debug the error for me + the question itself
  • Calling C Function in Dll Causing Problem

    8
    0 Votes
    8 Posts
    0 Views
    M
    i think You need to include the object module of header.cpp inside the build of your dll.
  • Inconsistentcies Between Win32 and MFC

    c++ question
    9
    0 Votes
    9 Posts
    0 Views
    F
    I set it in my resource file just SS_OWNERDRAW WS_CHILD WS_VISIBLE I tried many methods including SETBITMAP to display the bitmap nothing worked until I used Create and Drawitem
  • c++

    c++
    2
    0 Votes
    2 Posts
    0 Views
    J
    This is a very poor question because you did not provide any information where that error occurs (code snippet), which compiler you are using, and probably typed the error message manually rather than copying and pasting. However, a quick web research brought this up: The function containing "for " not expanded inline - what does this means and how may i correct it[^]
  • Adding Text to the Frame Of a Dialog

    graphics question learning
    12
    0 Votes
    12 Posts
    0 Views
    F
    How about doing the same logic in an override of CStatic::DrawItem the ldrawitemstruct has a DC I'll create a control with SS_OWNERDRAW DDX_Static or Control it The frame work should then call my Drawitem ?
  • Vector as function return

    c++ graphics debugging help tutorial
    2
    0 Votes
    2 Posts
    0 Views
    L
    Your function definitions are wrong in the second version as you are declaring two different return types. The first version was correct. Also, in the first case you say the second value pushed onto the vector is a load of junk, so you need to look at the code of GetMyInfo(RS.Get_UL("ulid",i)); to check what it is returning.
  • const "getter" but updating on request?

    design help question announcement
    4
    0 Votes
    4 Posts
    0 Views
    J
    I understand that it is a lot of work. But doing it the wrong way will make it even more complicated for future updates (especially when those have to be done by others). The trick here is finding the code that calls this single non-const function (and expects that an update is performed) and replace that. You may use your development tools to find these calls (many have options like "Find Usages").
  • 0 Votes
    3 Posts
    0 Views
    F
    Thanks so much I had the uninilized local variable problem. Thing Is dubugging release is hard because I cannt display variables even if I point to where the .pdb file is. I typically go into disassembly mode and get an idea of the value Thanks
  • Print class Members?

    8
    0 Votes
    8 Posts
    0 Views
    CPalliniC
    You are welcome.
  • Can

    1
    0 Votes
    1 Posts
    0 Views
    No one has replied