13,197 questions
-3
votes
0
answers
132
views
MFC compiles but doesn't open dialog when built with VS2022+ [closed]
I have a massive C++14, Win32 project that uses legacy MFC. So far, project compiles and works fine at Platform Toolset v142 (vs2019) and latest Windows 10 SDKs.
However, when I set the Platform ...
0
votes
0
answers
41
views
Using a derived edit box control to process keystrokes ahead of CEdit control in MFC
In a modeless dialog box in MFC, I want to create an edit box control, derived from CEdit, that will allow me to intercept keystrokes (in particular the CR) and process it differently from the default ...
0
votes
0
answers
81
views
Loading a resource DLL build for a different architecture to only assess resources
I'm programming a MFC application that should be internationalized. Currently I'm providing separate language DLLs per architecture (ARM64, x86, x64), but I'm unsure whether this is really necessary. ...
0
votes
0
answers
50
views
Using ITaskService set up "Basic" Event instead of "Custom" c++/mfc
I'm using C++/MFC to configure a Task Scheduler task that is triggered on an Event. I set it up manually and exported the task to get the gist of what I need to set up.
I have this working fine but I'...
3
votes
1
answer
208
views
Getting a compilation error when using a MFC CList with CStringArray elements
I have created a list of strings like this:
typedef CList<CString, CString&> MyListOfStrings;
MyListOfStrings aListOfStrings;
It compiles fine. Now I want to replace CString with ...
0
votes
0
answers
47
views
FarPoint Spread COM embedded button/combo editors turn black or lose arrow after theme/color change
I’m using FarPoint Spread COM (version 8.0.0.29) in a C++ MFC application.
I'm coming across an issue where, after running the app for a while, the embedded button cells paint black and the embedded ...
0
votes
0
answers
46
views
Override of OnMoving() in MFC not functioning
I need to track the location of a window while dragging by the title bar. Class Wizard did the boilerplate part of the work.
In the .h:
ON_WM_MOVING()
END_MESSAGE_MAP()
In the .cpp:
...
0
votes
0
answers
592
views
C++ MSB8041 Error: MFC libraries are required for this project
I installed every available MFC option, which is not out of support, restarted Visual Studio 2022, and I still get this error.
MFC libraries are required for this project. Install them from the ...
0
votes
1
answer
85
views
Using CTaskDialog with hyperlinks is messing up multiline command buttons
I am trying to show a task dialog:
CMeetingScheduleAssistantDlg::ScheduleCheckResult
CMeetingScheduleAssistantDlg::ShowResultsInTaskDialog(
const CString& content,
const bool ...
4
votes
2
answers
265
views
Retrieving unknown exception information
How can I get information about an unknown exception, like in the code below?
void foo()
{
throw 'A';
}
...
try
{
foo();
}
catch (const std::exception& exc)
{
std::cout << exc.what();
...
0
votes
1
answer
107
views
CEdit only responds to CTRL + V after click, not with SetFocus() [closed]
I am having a problem in MFC where a CEdit derived Edit-control only reacts to CTRL+V after it has been clicked on. Calling SetFocus() on it gives it keyboard focus, characters can be typed in it, but ...
0
votes
0
answers
69
views
How to add MS Office classes in Visual C++ 6 to make possible run Excel and create some pages inside?
I need some help with a very ancient version of Visual C++ (VS6, MFC). I have an old project (2005 year approx), it can run Word through OLE and generate some page inside. As far as I remember I added ...
0
votes
2
answers
173
views
How do I create a generic wrapper that can call other functions that have arbitrary and arbitrarily many inputs?
I have a series of functions and objects in C++ that will be called/invoked by Lua, I already have existing code that does exactly this (using the MFC COM dispatch) for VBScript (see the bottom of ...
0
votes
1
answer
192
views
In VS2022 C++ how can I set the background color of the main window in a doc/view app?
It would seem to be a trivial matter. I'm writing a C++ document-view app in VS 2022. I want to change the background color of the main window's client area. I don't need to change it dynamically ...
0
votes
0
answers
131
views
Bug in `CopyAcceleratorTable` from `winuser.h` on 64-bit?
I am experiencing a weird bug in the function CopyAcceleratorTable when compiled for 64 bit (CopyAcceleratorTable).
I have two accelerator tables (from two dlls) which I want to concatenate into a ...
2
votes
0
answers
163
views
CUDA 12.8 causes #error: MFC requires use of Winsock2.h in MFC project, but works fine with CUDA 12.4
I'm working on a Windows MFC GUI application that uses CUDA for high-performance image processing.
Previously, I was using CUDA 12.0 on a system with an RTX 3090 (Ampere), and everything compiled and ...
0
votes
0
answers
42
views
How to have two different components both using Microsoft Detours to detour the same function?
DarkTaskDialog is an excellent way to support a dark version of the task dialog in a MFC project. Example from the documentation:
I have added support for dark mode to about 95% of controls in my MFC ...
0
votes
0
answers
74
views
Microsoft Resource Compiler assigns different IDs for StringTable resources than what is given in Resource.h and the .rc file?
I'm converting what were formerly separate DLL and EXE modules of an MFC application (that is itself based on combining two disparate codebases) into static library (LIB) projects. I took steps to ...
0
votes
0
answers
110
views
Hosting a WPF control in a native MFC Dialog C++ application
I would like to host a WPF control in a MFC Dialog application. I am following the chapter 7.4.1 (Using a mixed-mode extension DLL) instructions mentioned in book (C++/CLI in Action by NISHANT ...
1
vote
0
answers
52
views
Can I stop the property grid control from keeping the item selected (when tabbing) or override colour?
I use the SetCustomColors function to set the colours of my CMFCPropertyGridCtrl object when in dark mode.
However, when you tab off to another control in dialog, the last row remains selected. This ...
3
votes
0
answers
50
views
Ensuring one instance of a Doc/View exists
Is there a way in a MDI application to see if an instance of a doc/view already exists?
I can create an instance from a menu command, but I want to ensure that only 1 instance ever exists at any time.
...
3
votes
1
answer
106
views
Assigning dark scrollbars to a CMFCPropertyGrid
I have seen the repository on GitHub:
https://github.com/ysc3839/win32-darkmode
I implemented the FixDarkScrollBars function in my test project. The good news is that it works for 99% of my dialog:
...
1
vote
1
answer
61
views
How to get my CMFCPropertyGridCtrl to use the "square with +/-" for toggling sections instead of "v"
In my test dialog I have a CTreeCtrl and a CMFCPropertyGridCtrl:
When I run these controls in dark mode they look like this:
The CTreeCtrl still has the expandable icons as a square with +/-. But ...
-1
votes
2
answers
69
views
How can I reduce my code using CString::Format
Is there some way to reduce this code?
CString j;
j.Format("%.2f", cardsum);
rep_templ.Replace("%cardsum%", j);
rep_templ.Replace("%cardsum%", CString().Format("%....
0
votes
0
answers
217
views
Windows Application Crash with Exception 0xC015000F: Is an Uncaught User Exception the Root Cause?
I am currently investigating a crash dump from a client site, as I cannot debug it in live mode. In short, the application crashes with the exception code 0xC015000F, which indicates that "the ...