Click here to Skip to main content
14,637,230 members
Rate this:
Please Sign up or sign in to vote.
See more:
I have use for SliderCtrlEx, but when I compile, I get the error message

"WINDOWS.H already included. MFC apps must not #include <windows.h"

i am="" using="" mfc="" in="" vs2019.
i="" not="" including="" windows.h.="" it="" seems="" to="" be="" coming="" from

"#include="" <afxtempl.h="">" in SliderCtrlEx.h.

Is there a workaround or a version compatible with VS2019?

What I have tried:

I don't have authorization to charge my client for the time it would take to fix this, even if I knew how.
Posted
Updated 9-Jul-20 16:17pm
Comments
Shao Voon Wong 10-Jul-20 3:01am
   
Where did you download the SliderCtrlEx from? You can ask the author on how to use it with MFC. Alternatively, MFC has its own CSliderCtrl class for slider, you could use that instead.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

I downloaded the sample program from this site called SliderClrDemo and it compiles just fine in X64 mode with a tweak or two. I added _AFXDLL to the project defines for using MFC in a DLL and added an include of SDKDDKver.h in stdafx.h to shut up some warnings and there were no problems. AfxTempl.h is included in the stdafx.h file.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100