Click here to Skip to main content
15,883,870 members
Please Sign up or sign in to vote.
1.00/5 (1 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

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.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900