Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
L

lor75

@lor75
About
Posts
15
Topics
8
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Draw in front of bitmap
    L lor75

    Dear Richard, many thanks for your help. I followed your suggestion and it works. In my previous code I put the IDB_BITMAP of the bitmap into the IMAGE property of the Picture Control in order to load the bitmap automatically. I hadn't used a control variable to load the bitmap. Now I have add a control variable and I load the bitmap before drawing the rectangle. In this way the bitmap is under my rectangles.

    C / C++ / MFC question c++ graphics tutorial

  • Draw in front of bitmap
    L lor75

    Hello, in a MFC program I've put a picture control (bitmap type) that display a bitmap image inserted into the resources. I want to draw rectangles on the bitmap so I've put the OnDraw method like this for example:

    void CDialog3::OnPaint()
    {
    CPaintDC dc(this); // device context for painting
    dc.Rectangle(0,0,300,300);
    }

    it's very simple and the rectangle has been drawn but it's overlapped by the bitmap when it is drawn in the region where the bitmap is located. For every rectangle I draw there is the bitmap in front of it. How can I put the bitmap rear my rectangles and rear any shape that I want to draw?

    C / C++ / MFC question c++ graphics tutorial

  • Simple newbie Tab Control question
    L lor75

    Hello, I've implemented a simple SDI program with MFC and a tab control used to select a child window from a set of 3 dialogs. I followed the instructions at this link: http://www.codersource.net/2010/01/30/ctabctrl/ Everything works if I put the handler of TCN_SELCHANGE in the view class. Instead If i put the handler in the CTabCtrl derived class of my tab control the handler is never called when I push tabs and the tab control doesn't work Can anyone explain me the reason?

    C / C++ / MFC question csharp c++

  • Exe file compatibility
    L lor75

    Hello, I wonder if there are compatibility issues with "exe" created by my project and Windows. I use Visual Studio 2008 for MFC projects. When I compile I create a project file that run on my PC (Windows XP) Can the "exe" file be executed in every Windows (XP, Vista, 7,8) without problems or do I have put some particular settings during compilation in order to get a universal exe that works in every machine?

    C / C++ / MFC csharp c++ visual-studio question

  • Edit control: number validation
    L lor75

    Thank you very much: this is the ideal function for me. Exactly what I was searching.

    C / C++ / MFC tutorial question

  • Edit control: number validation
    L lor75

    Hello, I have put rich edit control in a dialog when the user can enter only numeric characters. Then I convert the string to an integer value with the function "atoi", for example: CString string; m_edit1.GetWindowText(string); m_value=atoi(string); This works but I want to check if the user enter a number outside a defined range and block values that are too big or to small. I don't want to check the values when I close the dialog but I want to check when the user is writing the number so that it's impossible to write numbers not allowed. The edit control must show only permitted value. Can anyone a suggest for me?

    C / C++ / MFC tutorial question

  • Unwanted radio button click
    L lor75

    Dear David, they aren't fired because you switch from one window to another without have a focus on radiobutton. If you click on a radio button with the mouse the radio button gets focus: if you switch frome one window to another you will see that the handlers are fired. If you never click on radiobutton with mouse this doesn't happen.

    C / C++ / MFC question c++ tools

  • Unwanted radio button click
    L lor75

    Ok, I have read the WM_SETFOCUS page and now I disable all the radiobuttons when the window lose focus. This works but it seems a strange solution to me. I wonder if there is a better way to solve the problem. I want to discard message from radiobuttons when they are launched by focus changes.

    C / C++ / MFC question c++ tools

  • Unwanted radio button click
    L lor75

    Hello, I have programmed a MFC utility with some radio buttons on the main window. When I click on a radio button the BN_CLICKED message is captured by the handler and does some task. I have seen an unexpected behaviour: when I open another window (hard disk explorer, control panel, speaker volume and also a generic folder) and then I close it, the radio button clicks even I haven't clicked the mouse on the radio button. I suppose that this is caused by my program's window that get the focus when I close the other window. How can I block this behaviour?

    C / C++ / MFC question c++ tools

  • Controls, variable and dialogs
    L lor75

    Yes, two variables. But I don't know if there is a better way to get the same result.

    C / C++ / MFC c++ architecture question

  • Controls, variable and dialogs
    L lor75

    Hello, i'm quite new to MFC programming and I would like if my software architecture can be simplified. Let's suppose to have an MFC program where I put a member variable in CView class. This variable is set by a control put in a dialog window called by a menù. I usually set a control variable in order to get the control value in order to avoid the GetdlgItem command. The value of the control is used to set a member variable inside tha class of the dialog window and then when i close the dialog I copy the value of the dialog's variable into the main window variable control variable -> member variable of the dialog window -> member variable of the main Cview window With this scheme I Have to use 3 variables for each controls and this is quite expensive. Can anyone suggest me a simpler way to get to synchronize the variable used by the main window with the value of a control inside a dialog window? Best regards.

    C / C++ / MFC c++ architecture question

  • Destructors
    L lor75

    I try to explain with an example: I create a CBitmap object used to put a bitmap on a custom button control. Do I have to destroy the object when I exit from the program or the object is automatically destroied?

    C / C++ / MFC c++ graphics help question

  • Destructors
    L lor75

    Hello, I’m new in MFC programming and I have a doubt about destructor's calling in a MFC application. I wonder if it’s necessary to insert destructors for the classes of the project. I suppose (but I’m not sure) that Windows automatically calls destructors for classes created by the project wizard (doc, view, frame…) when I stop the program execution and close the program window. But what’s the situation for classes that I have inserted in the software? I never put destructor for these objects (dialogs, strings, bitmap, controls, custom objects…) Is this a problem? What could be the problems in this situation? Best regards.

    C / C++ / MFC c++ graphics help question

  • MFC background color
    L lor75

    If i put Invalidate(); in the handler I get the message: "error C3861: 'Invalidate': identifier not found I have a doubt: Invalidate is a method of Cview class and I call this function inside a method of CDocument class. Is this calling correct? How can I call a method of a class inside a method of another class?

    C / C++ / MFC question c++ help tutorial

  • MFC background color
    L lor75

    Hello, i'm a newbie in MFC programming and I'm writing a simple and silly program that change the background color of the window by selecting the color in the Menù. I've created a menù with 5 color and each color has its own ID message. I put the handler of these messages in the Document class of the program: i don't know if this is correct. How can I change the color of background? I'm a bit confused because I would like to invalidate the client area and set the new color in OnDraw Method but I can't invalidate the area because if i put Invalidate() in the handler of the menù i get error. These questions could be silly and obvious for an expert user but I don't know how to proceed. Can anyone suggest me the way to do? Best regards.

    C / C++ / MFC question c++ help tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups