Use Stack Overflow for Teams at work to find answers in a private and secure environment. Get your first 10 users free. .

Questions tagged [mfc]

This tag should be used for questions concerning Microsoft Foundation Class Library (MFC), a C++ framework for Windows desktop GUI application programming. You should specify a tag for the version of C++ or Visual Studio being used. Due to the size of MFC, additional tags such as [com], [wininet], [winapi] or other subject matter tags are helpful.

Filter by
Sorted by
Tagged with
0
votes
0answers
12 views

MFC: How do you get the + indicator to show when using the CImageList/CListCtrl/CTreeCtrl method for drag and drop operations?

I'm using the MS technique shown in Q148738 for starting a drag operation going from a listview to a treeview. The drag starts via LVN_BEGINDRAG, having the CListCtrl::CreateDragImage create the drag ...
-5
votes
0answers
33 views

Looking for a good MFC resource [on hold]

Found myself in a position where I need to understand, maintain, and add functionality to a rather large codebase that relies on MFC. Can anybody recommend a quality resource (website, course, book) ...
1
vote
0answers
22 views

How to use UTF-8 encoding in VC++ MFC application

I'm trying to add "static text component" (simple label) with UTF-8 encoding text into my windows application. If I use the designer tool in visual studio 2017 and put the text through properties - ...
0
votes
1answer
45 views

changing mouse cursor to wait cursor then starting worker thread and changing back on thread completion

In an older MFC application I have to perform a network connect request to another computer which may take a number of seconds in the case of incorrect computer name before the request times out. So I ...
-1
votes
0answers
26 views

Reading CFG file and using as variables in Visual Studios MFC application

I have generated a .CFG file which contains a string for name and a bool for result. I want my program to read this .CFG file and use the results to determine certain parameters. The .CFG file looks ...
0
votes
0answers
27 views

Porting MFC application from visual studio 2005 to 2015

I am porting an mfc application from VS 2005 to VS 2015. I simply upgraded by opening the application in VS 2015. It built successfully with some minor changes. I am facing a Problem during runtime. ...
2
votes
1answer
41 views

CCheckListBox items get overlapped on selection if app build using 'Visual Studio 2017 (v141)' Platform Toolset

Currently trying to use CCheckListBox control into a project. The project is a simple MFC Dialog based application. Into the dialog added List Box control with below specific property. Owner Draw -&...
0
votes
1answer
49 views

Query regarding extracting points from a CRgn Object

I have created a CRgn, with CRgn::CreatePolygonRgn(). Now I need to extract these points from that region. I found that the data's can be extrated using the CRgn::GetRegionData(). but unable to get ...
0
votes
1answer
86 views

MFC Redraw window in paint application problem

I'm trying to write Paint on MFC but I have a problem with redrawing window while draw new figures, move or resize existing ones. When I use Invalidate() or InvalidateRect(NULL) after every mouse move ...
1
vote
0answers
25 views

Multithreaded Client Server chat application using MFC CSocket and CWinThread

I'm trying to develop a chat application using MFC. In my program there will be Single Server and multiple Clients. I Need help in clearing some roadblocks. Since there are multiple clients involved ...
-1
votes
0answers
78 views

c++ - Compare relationship of two folder

I would like to compare two folders, to know if one folder is inside the other one. For example: C:\folder\ c:\folder\subfolder\ obviously yes: the folder 2 is "child" of the folder 1. Let's see one ...
0
votes
1answer
33 views

CHtmlEditCtrl - How do I get the edit control to wrap?

The CHtmlEditCtrl Create method says it ignores the dwStyle parameter anyway. HTML is supposed to flow/wrap by default. There should be a call/style to make it wrap.
1
vote
3answers
69 views

Resetting a bunch of radio buttons

I have a dialog box with over 500 radio buttons. I want to create a button for users to click to reset all the radio buttons in case he/she made too many mistakes. I have tried doing them ...
1
vote
1answer
60 views

how to define function pointer compatible with using lambda with capture as call back

Needing several variations of a simple modal dialog with an MFC project, I wrote a simple class, CDialogDlg, which extends the standard MFC CDialog class and contains hooks for implementation specific ...
0
votes
0answers
26 views

Compiling code using MFC or ATL headers with MinGW on Windows?

I'm trying to determine if it is possible to use MinGW to compile code that requires Microsoft Foundation Classes (MFC) or Active Templace Libraries (ATL), libraries that come with Microsoft Visual C++...
0
votes
0answers
32 views

Error C2385 mbiguous access of 'InternalQueryInterface'

I have created an ATL project with MFC support for my project requirement, but while building by solutions begin_com_map which defined inside my .h file throws an ambiguous error. Please find the ...
1
vote
1answer
44 views

MFC Button Click is Responding to Escape Key

When the dialog is opened and the escape key is pressed, a button click event is firing, the dialog should dismiss not run the event. I have inspected the Resources file in notepad to see what is ...
0
votes
0answers
41 views

How can I split a large DLL into smaller DLL's?

I have a large Visual Studio solution that contains many DLL projects. One of them "MyDLL" has dozens of source cpp files, and they often are interrelated via class hierarchy. The problem is that it ...
-2
votes
1answer
59 views

Retrieve item value from DWORD_PTR in combobox?

I want to Retrieve the item value(string) s where is s is DWORD_PTR s = m_laybox.GetItemData(idx); Basically, s is selected item and I am saving in config now how can I get item value(string) from ...
0
votes
0answers
25 views

How to get click event for a libVLC media playing on top of a CStaticCtrl

I am playing a local media file on top a CStaticCtrl in a dialog based MFC application.I do get STN_DBCLICKED events normally as I would be getting.But when I embed the media using libvlc media ...
0
votes
2answers
58 views

How to set checkbox as check by default in an MFC dialog application?

I'm trying to set some check boxes as checked by default in my MFC dialog when it runs. I have created a CButton variable for the check box called m_check. Next I added m_check.SetCheck in ...
0
votes
1answer
31 views

MFC: Which CFrameWnd function is called after CView::OnInitalUpdate() is called?

I have an MFC app that uses a CSplitterWnd to create multiple-pane views. That process is done in the CFrameWnd::OnCreateClient() call. After that, at some point, the various views have their CView::...
0
votes
0answers
21 views

How to control a scanner device from a web app through sample common API of that device?

I have a common API of a scanner device. Which also has a demo MFC application written in visual C++ which has events like OnPowerOn(), OnPowerOff() which fires by clicking specific button from the ...
0
votes
0answers
33 views

Selecting a socket interface for any unknown environment

Question background: My MFC CAsyncSocket-based socket code has worked fine in the lab for a long time, until it didn't (see how to determine socket interface type). It's design was based on the ...
0
votes
1answer
42 views

how to determine socket interface type

A little background for the question: I recently had a near-death experience with Microsoft and socket binding. I was testing production code and one of the test PCs kept failing. I eventually ...
1
vote
1answer
72 views

MFC dialog based application fails to invoke dialog twice

I have an MFC dialog based application where I want to change the dialog. To do this I close the dialog and try to load it again with another dialog template. The second invocation of the dialog fails ...
0
votes
1answer
39 views

Creating an MFC that can run other dlls. Debug Assertion Failed after project is ran

I have 2 functioning dialog based projects. My goal now is to create another simple MAIN project, such that when the MAIN project in ran, 2 push buttons appear and when the user clicks on them, the ...
0
votes
0answers
73 views

Not able to see List in window initially

I want to display list items in a separate window. But when the window opens it doesn't display the list. I can click the list item but I cannot see it. If I click on data it appears one by one.Also, ...
-1
votes
0answers
47 views

How can I switch from different windows using MFC?

I'm starting with MFC and trying to build a simple application using "MFC Application" -> "Single document". My question is let's say I create a new menu followed by sub-menus (Form1, Form2, Form3...)....
-1
votes
1answer
69 views

Cocreateinstance consuming high cpu

I am using a LOGSERVICELib.dll exposed interface methods as logging method in main project. There is abc.h file in main project where it create instance of LOGSERVICELib.dll and uses it's exposed ...
0
votes
1answer
70 views

When is an overridden virtual function not called

I'm working with MFC's CRecordset class. I have overridden the virtual method DoBulkFieldExchange. In general, my overridden methods are called and working just fine. However, I have a situation ...
-2
votes
0answers
28 views

How to implement a CDockablePane container frame

I want to create a SDI MFC app with dockable panes using a similar mechanism as the document pane frame of VisualStudio were they are maximized. It is similar as the problem in this question: How to ...
1
vote
1answer
62 views

Provide feedback to Microsoft about MFC

(If this is the wrong place to post this, could someone please let me know where would be better.) I don't know if Microsoft still works on MFC anymore. I'm trying to find out if there's any way to ...
0
votes
0answers
40 views

How to change GDI's scanline size from 216 bytes to 210 bytes

I want to send change the GDI's scanline size from 216 bytes tp 210 bytes. My application sends the data to GDI. And through port monitor, data is passed to my driver for printing. My driver accepts ...
1
vote
1answer
47 views

Why does my edit control “add variable” popup box not have CString as an option

I'm very new to MFC and dialog boxes. I am attempting to follow a very simple YouTube tutorial: "VC++/C++ MFC tutorial 1: Creating a Dialog box for user input" The video, and many other sources seem ...
-2
votes
0answers
27 views

I need an edit control that only sends a en_update to the parent when enter is hit

I need an edit control that only sends EN_CHANGE message to parent when the ENTER key is hit. This is my solution including code to the problem. It works, I just hope it will help the next guy. ...
0
votes
2answers
100 views

Which Windows API in C++ will help me in identifying which Dialog Class the Current ComboBox is using?

How can I know that for a particular ComboBox which Dialog Style is being used? Is there any Win32 API which can give me that information? I am using CDialog for a few ComboBox, CDialogEx for some, ...
0
votes
0answers
56 views

Hide CHtmlView Download Dialog Box

I have created a basic CHtmlView in an MDI application, that I can use to navigate to Winrar downloading link for example (https://www.win-rar.com/predownload.html?&L=0&Version=32bit). Once I ...
2
votes
1answer
77 views

Transparent bounding box of an ellipse

I'm writing some C++ code to draw ellipses. Sometimes these ellipses could be stacked on top of each other in a grouping. When they are stacked on each other, I'd like to have the bounding box of the ...
-2
votes
2answers
105 views

How could I handle a Window's Message?

I'm working on some CreateWindow things. My work need I to insert a Button into one of an Application's Window, and when I click the button, my application can do something. That Application isn't my ...
-1
votes
2answers
64 views

Free CArchive implementation? [closed]

I have a legacy file that was created using MFCs CArchive class. For different reasons I can not use MFC any longer but want to load these files. So my question: is there a (open source) replacement ...
0
votes
1answer
26 views

Is there a way to play multiple files in a single dialog/view with synchronization using libvlc

I am required to create an MFC dialog which can play 8 video files at a time.The additional requirement being able to play videos in sync. So far I have created the dialog with one media player to be ...
3
votes
2answers
76 views

How to change MFC View by clicking a Button inside the MainFrame

I want to change the presented View by clicking a button inside the Window like this. My Project settings: I made an MFC Project (SDI) without Doc/View support. I made two more Views in the Designer ...
1
vote
1answer
42 views

Data exchange finished in CPropertyPage::OnOK?

My dialog box derives from CPropertyPage. I've overridden OnOK() in order to run some custom checks. However, it seems that Dynamic Data Exchange (DDX) has already completed and my class variables ...
1
vote
0answers
46 views

Calling Python file from c++ using CreateProcess

I would like to run python script file on MFC Button click using CreateProcess(), so that I can capture the output of a process in realtime using a pipes. CString sCmd = "Cmd.Exe"; CString sParms = "...
1
vote
1answer
113 views

Warning C26495 for initialized static variables

I really don't understand why I'm getting warning C26495 in my constructor regarding m_pszDriverPreferred and m_pszDriverSearchTerms. Header File class CMyClass : CBaseClass { private: static ...
0
votes
0answers
61 views

capture keyboard character as string

Under PreTranslateMessage() check the keydown event and capture the same in some variable, Keydown event capture the value for single character only, But I would like to capture certain no of ...
0
votes
0answers
30 views

Can I convert 'DECLARE_DYNCREATE' to 'DECLARE_DYNAMIC'?

I want to implement popup dialog by inheriting CMFCDesktopAlertDialog class. However, this class can only be used by declaring the 'DECLARE_DYNCREATE' macro. Is there a way to declare the '...
0
votes
2answers
82 views

How to select the location that file is being saved to? [duplicate]

I am relatively new to C++ and I want to be able to open the file explorer and be able to select the location to be saved to. It currently saves within the same folder as the c++ files. How do I go ...
-1
votes
1answer
32 views

Cefsharp CLR initialization crash in MFC project

I created a CLR class as DLL and loaded cefsharp,cefsharp winforms,cef core through Nuget package in vs 2015.When I run it in a sample MDI CFormView application it works.But when I try to run it in my ...