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
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • How do you get type from format?

    help tutorial question learning
    6
    0 Votes
    6 Posts
    0 Views
    V
    Thanks for reply, figured it out myself, but did not have time to reply. As far as your first sentence goes, take a refresher course and read "how to answer the question". You reply was great, but you do not have to be so snippy about it. GOT MY POINT? Have a swell day.
  • 0 Votes
    3 Posts
    0 Views
    L
    As Richard said enum is 1.) Restricted to a 16 bit integer constant 2.) Must be defined at compile time Your pointer is longer than 16 bits and the address is only available at runtime, so it double fails. You also haven't typedef the structure to a name. I suspect this is what you are trying to do typedef struct MyStateStruct\_t { int a; } MYSTATE; // typedef the structure to a name typedef enum { MY\_SELECTOR\_0 = 0, MY\_SELECTOR\_1 = 1 } MyEnum\_e; const MYSTATE myStates\[2\]; // use structure name enum MyEnum\_e selector = MY\_SELECTOR\_0; // Set selector to 0 int result1 = myStates\[selector\].a; // result1 is myStates\[0\].a selector = MY\_SELECTOR\_1; // Set selector to 1 int result2 = myStates\[selector\].a; // result2 is myStates\[1\].a In vino veritas
  • 0 Votes
    12 Posts
    0 Views
    D
    Excellent points and suggestions, and I've implemented much of what you suggested. In the end it turned out the device was waiting for a response from the computer to indicate the read was completed, which I accomplished with a TransmitCommChar. Clunky but it works.
  • Arrow Key use in MFC vc++ Application

    c++ help
    3
    0 Votes
    3 Posts
    0 Views
    R
    Hi Chris Losinger Yes this is dialog-based application but arrow key functionality i need to apply in canvas/editor not in dialog. Thanks
  • How to master C++

    learning csharp c++ java javascript
    6
    0 Votes
    6 Posts
    0 Views
    S
    Make your hands dirty by entering into solving some problems
  • CString Concatenation question

    performance help question
    4
    0 Votes
    4 Posts
    0 Views
    S
    :thumbsup:
  • How to fix the invalide pointer problem

    help c++ com performance tutorial
    4
    0 Votes
    4 Posts
    0 Views
    S
    Running with a memory leak detector can help?
  • 0 Votes
    9 Posts
    0 Views
    S
    May be it is orthogonal information, If we want to hide/restrict usage of default copy constructor, we need to provide override declaration in private section of class, and no definition for that. This ensures preventing usages of copy constructor
  • Migrating old project to VS2008 - resource file errors

    help c++ question learning
    9
    0 Votes
    9 Posts
    8 Views
    C
    Well, to update this query by me so that someone might be helped in the future: VS2008 does not even come close to properly converting a project from eVC++. There are so many macros left undefined from the conversion that VS2008 is not able to handle its own includes let alone the application. The problem has absolutely ZERO to do with any specific resource file. It's caused by the pathetic migration effort made by VS2008. Save yourself some time and (a) create a simple smart device project appropriate for you in VS2008. Then (b) migrate the existing code base in one at a time. Even then your dialog resource processing may need manual intervention. Charlie Gilley Stuck in a dysfunctional matrix from which I must escape... "Where liberty dwells, there is my country." B. Franklin, 1783 “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
  • why "Invalid Gender!"?

    help question
    6
    0 Votes
    6 Posts
    0 Views
    A
    ohh.. i see.. thank you very much :3
  • how to be sure each child class inherits a method?

    help question oop tutorial
    8
    0 Votes
    8 Posts
    0 Views
    L
    1. Change all private into 'protected' 2. For testing purpose do trial and error of pure virtual test on each level. Best wishes
  • Convert string name to Control ID Name

    8
    0 Votes
    8 Posts
    1 Views
    L
    I think control array will help you. void CControlArrayDlg::DoDataExchange(CDataExchange* pDX) { CDialogEx::DoDataExchange(pDX); DDX_Control(pDX, IDC_BUTTON1, m_CtrlButton[0]); DDX_Control(pDX, IDC_BUTTON2, m_CtrlButton[1]); }
  • 0 Votes
    12 Posts
    13 Views
    L
    Academic point of view: You should avoid using autocomplete or similar helpers so that you can have better hands-on. Professional point of view: You should not miss any helpers (autocomplete, automation etc.) so that you become more productive. Best wishes :)
  • how to use socket in Visual C++ 6.0

    c++ tutorial
    3
    0 Votes
    3 Posts
    0 Views
    V
    Another great J.Newcomer essay: KB192570: MFC Asynchronous Ports[^]
  • Well wishing

    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Image processing in C

    tutorial question
    10
    0 Votes
    10 Posts
    1 Views
    L
    I have no idea why you feel the rant is necessary .. I have referred it to admin I found your comment strange for the following reasons, so we are clear 1.) The original PNG library was written in C and is still maintained (20 years so far) 2.) It's dubious there is any advantage on converting PNGLIB to C++ you are just likely to get bugs any C++ compiler can compile PNGLIB anyhow 3.) The OP said nothing about windows 4.) Even if you are on windows the GDI+ does not support PNG because it is licenced .. SEE => PNGLIB. Even IPicture which support JPG and GIF does not support PNG. So you would still have to write your own GDI+ extension code. There is no malice intended, I just think your advice was misguided for the above reasons. Now if I am in error on any of those points then please let me know. In vino veritas
  • 0 Votes
    9 Posts
    2 Views
    D
    it's just help for other :)
  • vc630 vending machines

    5
    0 Votes
    5 Posts
    0 Views
    P
    Call machine support. I think nothing can be done without physical access to the machines. Patrice “Everything should be made as simple as possible, but no simpler.” Albert Einstein
  • Carlos Antollini ADO classes

    c++ database help question
    2
    0 Votes
    2 Posts
    0 Views
    V
    Did you debug this CADODatabase::Close() code?