mfc

Added functionality for edit control with up-down buddy control

I have an edit control class and a up-down control class, which derive from CEdit and CSpinButtonCtrl respectively. The up-down control has the UDS_ARROWKEYS style, and has the edit control set as buddy. This means that pressing the Up/Down arrow keys in the edit box is equivalent to clicking the Up/Down buttons. The buttons are even ani...

Custom draw CTreeCtrl: how to add font strike through?

I have implemented custom draw for an CTreeCtrl in my MFC Smart Device program. I have successfully changed the color of specific nodes of the CTreeCtrl. I am now trying to understand how to get the default font used to draw text in the control so I can add a strike-through to the font for certain nodes. How would I go about getting t...

How do I convert a 24-bit colour image to binary image using MFC?

how to convert a bitmap image in binary image? ...

need some help in making slider control

i have made the slider control in c++ using MFC. there is my code. void CImageAnalyserDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) { if(nSBCode == SB_THUMBPOSITION) { slidervalue.Format(_T("%d"), nPos); UpdateData(false); } else { CDialog::OnHScroll(nSBCode, nPos, pScrollBar); } } every thing is don...

Problem with Threads in MFC project

Mabye someone over here can explain to me what am i doing wrong...This is after reading a lot of articles over the net and doing what say said over there...and not working.... My problem is that i am developing a nice little game with a background music and explosion sound, for the explosion i know i need to use threads or my music stop...

how to rotate a bitmap image in c++ using MFC?

how to rotate a bitmap image in c++ using MFC? i dont wanna use GDI. is it possible by only changing x and y values in this code? CBitmap img; CDC dc; BITMAP bmp; img.LoadBitmapW(IDB_BITMAP1); img.GetBitmap(&bmp); CDC* pDC = this->GetDC(); dc.CreateCompatibleDC(pDC); CBitmap* pOld = dc.SelectObject(&img...

Standard Constructor with CPoint argument in MFC

How can I declare a standard constructor in MFC that expects a CPoint argument, e.g. class CObj { public: CObj(CPoint pt = ???, float x = 10.0f, int n = 10); ... I tried CObj(CPoint pt = (10,10), float x = 10.0f, int n = 10); which compiled just fine, but only pt.x got the value 10 while pt.y became 0. Thanks, RS ...

How to create a process that is not a child of it's creating process?

I have two processes, A and B. At some point A creates B. After B is created, if A's process tree is killed, I want B to still be around. I am using CreateProcess() to create B, and I can't seem to find any way to make it create the process without it being a child. Same thing with ShellExecuteEx(), but I am probably missing some flag. ...

Add a bit map image to Radio Button in vc++

Hi All, I need to add a bit map image to a radio button in MFC . i have no idea on how to do it can any one tell me how to do it. ...

Drawing on 8bpp grayscale bitmap (unmanaged C++)

Hi all, I've been attempting to draw on an 8bpp grayscale bitmap without success. Here are some of my attempts. Maybe someone can point out what I'm doing wrong. =================================================== Attempt 1: Create, select, and draw: In constructor: CBitmap bm; bm.CreateBitmap (200, 200, 1, 8, NULL); In OnDraw: ...

Where can I see printf output in an mfc applcation?

Where can I see printf output in an mfc application during debugging? Is there a "console" window I can view in the debugger? (Visual Studio C++ 6.0) Thanks. ...

Breaking on a button click event in Visual Studio debugger

This question is regarding the debugger in Visual Studio 2008. I am working on a C++/MFC application with a huge codebase (thousands of .cpp files). I'm looking for a way to tell the debugger, "The next time I click a button in my app, stop at the function called by that button". I'm trying to avoid trolling through those thousands of fi...

Split functionality for MFC Cstring Class

How to Split a CString object by delimeter in vc++? for example i have a string value "one+two+three+four" into a CString varable. ...

MFC: CCheckListBox items overlap

In a dialog template I placed a ListBox, since checked list box is not shown in the visual layout options. I set it to owner-draw and set it up with DDX, changing the associated class variable from type CListBox to CCheckListBox - in other words the only changes I make from what the wizard does for me are set owner-draw, and chnage the m...

What class/control is used when you place a Picture in a MSVC++ dialog template?

I've not been able to find this out, which seems weird. When I add a class variable for the control using the wizard, it wants to add a CButton. Is there a specific control or does one of the basic ones provide this function? ...

MFC: Save from CImage to database as selected file-type

We have a requirement that a user can load any standard image into a dialog, the image is displayed, and the image saved as a specific format (JPG) in a database. It seems CImage is the class to be using since it can load and save BMP/GIF/JPG/PNG. But is there an easy way to save the JPG as a BLOB in the database without calling CImage::...

Listview flickers on Win32 dialog when removing and re-adding all items and all columns

Consider a plain Win32 dialog with listview control (in report mode) written in C++. Upon a certain event all items and all columns are deleted and new columns and items are created. Basically, as content changes, columns are automatically generated based on content. When old items/columns are removed and new ones added, listview flicke...

SQLite OLE DB driver for C++ (MFC)

I am looking for OLE DB driver to acces SQLite. Is there any? I need it to use under MFC, not .NET. I have found this but it is .NET driver: http://CherryCitySoftware.com/ccs/Home/Default.aspx and this but I have no references to this: http://www.newobjects.com/product.asp?Category=71 Thanks ...

Add a image to RadioButton in a ListBox

I have a List Box hwich is modified in a such a way that each row will have Radiobutton .Now my requirement is each of these Radio button must have a bitmap image followed by some text . i have codejock xtremetoolkit 13.4.0 installed . I am new to UI design and xtreme toolkit.Can any one help me out please. ...

Why isn't the dropdown arrow drawn for an CMFCMenuButton?

I ran into this issue when trying to add a CMFCMenuButton to an existing MFC application. It worked properly, and even resized the button to accommodate the dropdown arrow. But it didn't draw the dropdown arrow, and when I hovered over the button, I saw the following debug output: > Can't load bitmap: 42b8.GetLastError() = 716 > CMenu...