1
votes

I've created a clean (non MFC) atl project, Added a dialog and some bitmaps, when compiling I get 3 MFC relate errors:

WINDOWS.H already included. MFC apps must not #include @ afxv_w32.h

Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d] @ afx.h

Since this project has nothing to do with MFC - why do I get these errors ? (in project settings under: "Use of MFC" = Use Standart Windows Libraries.

I've checked the Preprocessor defines: WIN32 _WINDOWS _DEBUG _USRDLL

nothing here as well.

Any ideas ?

UPDATE: I've found what I've done wrong. Instead of adding the dialog from the Class Wizard, I've created it in the resource view and than added a class. This creates an MFC class and not an ATL class.

1
You see to have included MFC somehow. (when added dialog? Or through #include). This is not something taking place with non-MFC projects.Roman R.
Just added a dialog, ATL dialog, nothing I haven't done before. I've done it more than once in similar projects. I am comparing and didn't find anything different this time.Dani
Use the /showIncludes compiler option to find out why <afxv_w32.h> gets included and work your way from there.IInspectable
I see the includes, I don't know what causes them. it looks like I'll have to start over and recompile after each step to find out what triggered this error....Dani

1 Answers

0
votes

I figured out what was wrong, updating here, for future users, as documentation of ATL is very poor.

I've added a dialog in resource view, and than added a class for it. That was the mistake. the class that was added was MFC class, although project was not supposed to support MFC.

If you wish to keep the project clean (from MFC) you need to add the dialog through Class View Add Class as described in this article:

Add ATL Dialog Box

If it wasn't ATL I would have posted it as a bug to MS, but I don't think they still care about this technology.