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
    3 Posts
    1 Views
    K
    Thanks Chris, that solved my memory leak issue. PKNT
  • error:Segmentation fault (core dumped)

    help asp-net linux data-structures debugging
    2
    0 Votes
    2 Posts
    1 Views
    J
    char filename = argc >= 2 ? argv[1] : (char)"Girl.emb.jpg"; I stopped reading the unformatted code after this point but it is very probable that this is the reason for the segmentation fault. It should be: const char * filename = argc >= 2 ? argv[1] : "Girl.emb.jpg"; I strongly recommend to use the -Wall GCC option when compiling and don't start the program while there are any warnings. Then you should have a got a lot of warnings with your code; at least in the next line if( (img = cvLoadImage( filename, 1)) == 0 ) where you are passing the char variable filename where a char * is expected.
  • Assertion From SendNotifyMessage

    c++ workspace
    14
    0 Votes
    14 Posts
    3 Views
    L
    ForNow wrote: I believe this has to do with sharing window handles between threads I don't think so. You should be able to send a message to a Window from anywhere.
  • Do you want to outsourcing your projects?

    com question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • DLL Features

    c++ csharp visual-studio com question
    3
    0 Votes
    3 Posts
    1 Views
    L
    Already answered in the ATL forum.
  • control #define directive

    question c++
    3
    0 Votes
    3 Posts
    1 Views
    L
    p3im4n wrote: but I cant use if statement in header! Why not? A header is just a text file that gets included into, and compiled as part of, some source code. It is quite common to do something like: // in header file #if defined(foo) // some code to be generated #endif // in cpp file #define foo #include
  • 0 Votes
    25 Posts
    3 Views
    S
    Finally I used MsgWaitForMultipleObjects with message process loop. I avoid to use EnableWindow() function at all. It seems to work fine under Win7. I will take a copy to my work tommorow to test it under XP for paint corruption. sdancer75
  • CAysncSocket Notifications

    design
    6
    0 Votes
    6 Posts
    0 Views
    V
    Your retelling of the Joe's reply is a little vague... But did you read his essays Detach[^] and KB192570: MFC Asynchronous Ports[^]?
  • C, Win32 API: painting on a tabcontrol [Solved]

    json
    10
    0 Votes
    10 Posts
    1 Views
    U
    l have gotten a solution. l added the following lines of codes base on msdn WM_SETREDRAW message (Windows)[^] SendMessage(hWnd,WM_SETREDRAW,(WPARAM)TRUE,0); RedrawWindow(hWnd,NULL,NULL,RDW_ERASE | RDW_FRAME | RDW_INVALIDATE |RDW_UPDATENOW |RDW_NOCHILDREN ); Thank you all who contributed.
  • how to disable uac prompt programmatically

    help tutorial
    5
    0 Votes
    5 Posts
    1 Views
    J
    Assigning administrator rights to an application requires administrative privileges. So while it does not have these, you can't change it. And you can not elevate the privileges of a running process. You can use a manifest to specify that your application should run elevated, use the "runas" command or start other applications elevated from within your program. But in all these cases there will be a UAC prompt. UAC is there for a reason. It is a security feature. The user decides which level of security should be used. An application can not bypass these settings.
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • 아시안카지노¶」SESA­9­.­CoM」¶월드카지노

    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • CAsyncSocket::connect ipaddr ?

    sysadmin question
    4
    0 Votes
    4 Posts
    0 Views
    L
    ForNow wrote: The description of HOST for connect is somewhat unclear . True; however a connect call is from here to there, thus to a remote system. Think in terms of telephones.
  • USB3 port: Programmatically force it to operate in USB2 mode

    hardware question
    8
    0 Votes
    8 Posts
    0 Views
    L
    Richard, we have a unit that needs to be tested on the production line, prior to shipping to the customer. The unit must work with both USB 2 and USB 3 connections. I won't go into the reasons why we need to test both connections but we do. At present the operator must manually take the USB cable out of the USB 3 socket, and put it into the USB 2 socket, and vice versa, when requested to do so by the test script. This introduces room for error, as they might get confused, and also they might end up damaging the USB socket since they will do this many times each day. So a better solution is to have a software controlled way to switch between USB 2 and USB 3 connections. Jochen's suggestion is a significant improvement on the current scheme.
  • ampersand don't underline my first letter in label

    debugging
    15
    0 Votes
    15 Posts
    0 Views
    I
    by pressing the alt key, or using a timer with sendkeys.send("%"), or turning on 'the Hide keyboard navigation indicators until I use the Alt key on control panel' fixed this poblem :)
  • Too many initializers error in MSVC.

    data-structures help
    5
    0 Votes
    5 Posts
    0 Views
    B
    I found this bug report[^], and it turns out that this is a VS2015u1 compiler bug. What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???
  • I this correct?

    c++ question
    28
    0 Votes
    28 Posts
    0 Views
    L
    Thank you sir for your kind help. I made it to work finally with the help of your code
  • 0 Votes
    3 Posts
    0 Views
    C
    Wow, thanks for the tools. Very helpful. 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
  • Catching User Activity

    c++ tutorial question
    12
    0 Votes
    12 Posts
    0 Views
    L
    Hi Bram, I totally agree with what you say about using particular versions of development software, although you do sometimes get forced to upgrade as newer versions of Windows appear. As long as it keeps working, satisfies your customers, and makes a reasonable profit, then there is no real reason to change. And thanks again for your kind words.
  • 0 Votes
    2 Posts
    0 Views
    B
    Well, I am not familiar with the class 'CAutoCompleteEditBox' etc. I still use MFC42. This version does not have anything that fancy, but the nearest would be a CComboBox, with the Edit option set to True. Make sure that the Resource Template has the property 'USER_DRAWN' if you want to add your own options. You add these on an EN_CHANGE message. The best way to investigate this is to open the Resource file in a Text Editor, and inspect and edit the values for the control. In MFC42 you would be required to, as a minimum, implement the '(On)DrawItem()' virtual function, The Standard Implementation of (On)DrawItem() Asserts in MFC42! I have in the mean time derived my own libraries for things like this. Hope this is of help. :) Bram van Kampen