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
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • LPNMITEMACTIVATE is always giving iItem as -1

    4
    0 Votes
    4 Posts
    0 Views
    U
    "To obtain the items being activated, the receiving application should use the LVM_GETSELECTEDCOUNT message to receive the number of items that are selected and then send the LVM_GETNEXTITEM message with LVNI_SELECTED until all of the items have been retrieved " How did you use LVM_GETSELECTEDCOUNT, LVM_GETNEXTITEM, and LVNI_SELECTED? Can you give an sample code to solve the problem mentioned?
  • 0 Votes
    7 Posts
    0 Views
    F
    This error comes on 64bits OS's when the loader try to link a wrong DLL (typically a 32bits DLL in a 64bits executable). Check again your project and verify that you are correctly linking to 64bits versions of all DLL's. Maybe your program use a DLL built for 32bits. The linking could complete even with wrong import library, then the error is triggered at loading time. The most common case is when a manifest is present in whichever library reporting X86 build, the loader, and this made me mad, testardly try to load 32bits version of commctl32.dll :mad:
  • WM_PAINT and WM_ERASEBKGND

    question
    13
    0 Votes
    13 Posts
    0 Views
    J
    Hi I think this is depend on how the window be update. When you call Invalidate(...), you can specify the erase background occuer or no. I think when you want to update only an item in the window like a button in the toolbar NOT all window area, WM_ERASEBKGND is not needed because not change made in other places of the window. Kind Regards. mrjavadtaheri@gmail.com
  • usb modem problem

    help question csharp com sysadmin
    3
    0 Votes
    3 Posts
    0 Views
    A
    Thank you to reply. I forgot to say, in 4days before it was working, and i could hear one way voice(outgoing call in dialing, and incoming voice when answer call), also i could play wave file, and record conversations. I do not know what happened exactly, but i guess i changed modem .INF file in trying to full-duplex support, and all failed after it, then i reinstalled previous modem. Also i do not know about ACM Codecs, i google it when i be in my work place. Thank you again!
  • Creating an .Obj File

    c++ data-structures tutorial question
    4
    0 Votes
    4 Posts
    0 Views
    F
    The format MS uses is standard indeeded, it is named PE (portable executable), and you can get whole documentation here[^]. It is made public to avoid penalties from antitrust because, if hided, it could be seen as an abuse. It is based on COFF, and its almost the same, apart from the interpretation of location offsets that are different. You can create a PE object header, include your data in an initialized data section and create a symbbol in relocation.. :laugh: But if only need to access that data in the DLL the really easy solution is, as they already told you, to create a resource and use it.
  • Convert Borland c++ project to VC++

    csharp c++ delphi visual-studio tools
    2
    0 Votes
    2 Posts
    0 Views
    D
    There is no tool to do this. You're going to have to either write the tool yourself or just skip it and convert the code by hand. A guide to posting questions on CodeProject Click this: Asking questions is a skill. Seriously, do it. Dave Kreskowiak
  • 0 Votes
    5 Posts
    0 Views
    L
    Take a look at http://support.microsoft.com/kb/222101[^].
  • g++ Compiler not including header file

    c++ hardware question
    5
    0 Votes
    5 Posts
    0 Views
    J
    I just saw you edited your post and got it. But I will answer anyhow (I had already written this but the CP servers where unavailable for some minutes): I suggest to read about definitions and declarations in C/C++ because these are often mixed up. See the first answer of this Stackoverflow thread: http://stackoverflow.com/questions/1410563/what-is-the-difference-between-a-definition-and-a-declaration[^] You have declarations for the functions in your header files. So the sources will compile. But you don't have definitions for the functions in any of your source files. So the linkage will fail. You must add the source files containing the definitions. For the readsig function this must be a source file containing: int readsig ( MiscParams *misc , char *namelist , int *nsigs , Signal ***signals , char *error ) { /* function implementation*/ }
  • 0 Votes
    3 Posts
    0 Views
    F
    If your question is, why the copy constructor and assignment operator are declared private: This is to prevent the users of the class from copying objects of that type. At least the assignment operator is created atomatically by the compiler, if the designer of the class doesn't explicitely specify one. This default assignment operator simply copies all members. So without the operator you could write M m1, m2; m2 = m1; and it would compile. With this class definition as it is, you will get a compile time error that the operator is not accessible. The good thing about pessimism is, that you are always either right or pleasently surprised.
  • 0 Votes
    14 Posts
    7 Views
    F
    You're welcome. :) If you have to start more threads with different strings, I suggest to allocate dynamic memory for each string to make it local for that thread. The thread can release the memory when it doesn't need it anymore.
  • fotron 77 to c++ conversion

    c++ css
    11
    0 Votes
    11 Posts
    0 Views
    L
    Nileshb111 wrote: Can u give a c++ code to calculate flux over 2D grids please Sorry, no, particularly as I have no idea what you mean by "calculate flux over 2D grids".
  • Make C dll as a COM DLL

    com tutorial
    2
    0 Votes
    2 Posts
    2 Views
    L
    I do not know what you Googled for, but there is a complete section of articles on COM here at http://www.codeproject.com/KB/COM/[^]. Michael Dunn's Introduction to COM - What It Is and How to Use It.[^] is an excellent starter.
  • WMI services?

    tutorial question
    2
    0 Votes
    2 Posts
    0 Views
    L
    john5632 wrote: I am getting incorrect value. What value, and what do you expect to be getting? What is ptrclsObj actually pointing at?
  • Help - Grid and recursive function

    c++ html css help tutorial
    8
    0 Votes
    8 Posts
    0 Views
    U
    Yes, and before this I just knew how to calculate areas and those things using C++. So, it is a huge difference hahaha
  • Environment variable is mandatory for open cv

    workspace
    2
    0 Votes
    2 Posts
    0 Views
    L
    You already posted this (three times) in your question in Q&A, and received two answers. Please do not repost.
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    6 Posts
    4 Views
    D
    mbatra31 wrote: I have one query again. this function gives the Last logon and Logoff time in the number of seconds that have elapsed since 00:00:00, January 1, 1970, GMT. How can I get the correct value in Time format. Converting time since that epoch was something I learned very early on in my career (some 25 years ago). It's worth the effort at figuring it out (without the help of Google). mbatra31 wrote: Also I want to get the record of user logon and logoff time for each day. Should I use the same function.? Since the above is always referenced from a fixed point in time, you'd need to "capture" it once per day. Admittedly, there may be a log somewhere that Windows keeps where it writes an entry for every time a user logs in/out of a workstation. I've never had the need to know so I can't tell you if this is true or not. "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
  • Dynamic Menu Creation

    tutorial learning
    9
    0 Votes
    9 Posts
    0 Views
    D
    Thakur JAI SINGH wrote: But it is not working for me. What specifically is not working? You have 5 statements here. Have you stepped through each one using the debugger to see which one is not working as expected? "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