Questions tagged [afx]

Application Framework Extensions (AFX) is the old name of the Microsoft Foundation Class Library (MFC). But still many functions of the MFC library are having the Afx prefix.

40 questions
10
votes
3 answers

Do I need afxres.h, if I am not using MFC? How do I remove it from the .RC script?

I don't know RC scripts. I want to include Product version, File version, etc. metadata into a DLL I'm building. I'm using an .rc file to do that. The build is makefile driven. I'm following along with an example .rc scrpit I found. The template…
Cheeso
  • 189,189
  • 101
  • 473
  • 713
7
votes
3 answers

windows.h and MFC

Why can't I include windows.h in afx(MFC) projects?
lital maatuk
  • 5,921
  • 20
  • 57
  • 79
3
votes
3 answers

Visual C++ 2008, errors while #include "afxdb.h"

I've got trouble using adxdb.h: I tried to #include "afxdb.h" But I recieved this error: C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\afx.h(24) : fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll…
mindmaster
  • 1,705
  • 3
  • 16
  • 18
3
votes
0 answers

MFC in Visual Studio 2012 - afx.h file not found

I created an new static library project in VS 2012, with option MFC selected. It created few files in the project, stdafx.h, targetver.h, stdafx.cpp. However in stdafx.h there are includes for afx.h, afxwin.h etc and they were marked as errors. I…
harimothu
  • 41
  • 5
3
votes
4 answers

MFC extension dll resources loading problems

I have built the folowing configuration: A) MFC Extension DLL having 2 MFC dialogs. B) MFC regular dll that uses DLL A functions. C) win32 application (NON MFC) calling for function from DLL B When calling functions from DLL B that inside call…
Dan
  • 33
  • 1
  • 4
2
votes
1 answer

Compiling MFC application with /clr (step1: linking against dynamic DLLs)

I have successfully upgraded an MFC application which was compiled with an old version of Developer Studio to Visual Studio 2008. A very small number of changes were needed because of some breaking changes in MFC. Now that everything works, I'd like…
Pierre Arnaud
  • 10,212
  • 11
  • 77
  • 108
2
votes
2 answers

__targv is NULL in my MFC windows application. argc == 1

I have a windows application setup as follows: Debug - builds an exe which statically links the libraries it uses Release - builds an exe which links to a DLL I've just created the release version, the only difference being is that one of the…
user756079
  • 301
  • 2
  • 13
2
votes
1 answer

What do I need to do to program an MFC/STL program in Visual Studio?

I've installed Visual Studio on my private PC, the version is "Microsoft Visual Studio Community 2019", version 16.1.6. In order to prepare a job interview, I'd like to do some basic MFC/AFX programming, starting by the basic CMapStringToString…
Dominique
  • 16,450
  • 15
  • 56
  • 112
2
votes
1 answer

How to handle with warning in C++ inline + template context?

I'm facing an interesting problem: I had an MFC application project in Visual C++ 6.0. Since there are many changes either in MFC or in C++ standard, I wanted to port my application to Visual Studio 2010. It was fine, but I am facing a warning now,…
user2218825
1
vote
1 answer

Implementation of the MPEG-4 standard Part 16 (Animation Framework Extension)

I've been having a look at 3D mesh compression; our application produces a stream of 3D surfaces that we need to save to disk and if possible apply compression to. I came across the MPEG 4 animation framework extension which seems to do what I…
jmp1985
  • 23
  • 5
1
vote
1 answer

Issue enabling folder browse button on CMFCEditBrowseCtrl

Here's what the resource manager shows for this particular EditBrowseCtrl. You can see that the "Browse Mode" option is set to "Folder Browse". And here's what the actual dialog box looks like when I run the program(no browse button): I've also…
Skewjo
  • 379
  • 3
  • 12
1
vote
2 answers

Unable to change the color of my dialog boxes in my application

I am attempting to create a "dark mode" for my Windows C++ app partially for fun, partially to try and fully comprehend the message passing in MFC, but I'm running into some really odd issues that I can't find explained anywhere. I've spent the…
Skewjo
  • 379
  • 3
  • 12
1
vote
1 answer

Wait for thread completion without freezing the UI in MFC

I am trying to start a worker thread using AfxBeginThread and wait until it finished. But I run into the issue, that I can either update the UI (show progress) without the thread conrol or wait for the thread but the UI freezes. I found out several…
alex555
  • 1,676
  • 4
  • 27
  • 45
1
vote
1 answer

Why setting DEBUG_NEW in an MFC app can cause compiler error

Here says that you may put DEBUG_NEW in place of new in your MFC app. When I do so the compiler says that DEBUG_NEW is not defined. It is VS 2017. _DEBUG is defined. What can be wrong? [edit] I should note first I placed it as a global define for…
Siavoshkc
  • 346
  • 2
  • 16
1
vote
2 answers

Accurate Sleep with cancellation

I need to implement a delay or sleep function that is accurate and consistent, and must be able to be cancelled. Here's my code: bool cancel_flag(false); void My_Sleep(unsigned int duration) { static const size_t SLEEP_INTERVAL = 10U; // 10…
Thomas Matthews
  • 56,849
  • 17
  • 98
  • 154
1
2 3