Implementing WDL_DirScan causes weird errors

I’m working on building a preset database using WDL_DirScan and sqlite, which makes searching for presets a breeze. I’ve implementing a recursive search algorithm very similar to the one found in IDirBrowseControlBase. I am receiving the following error directly from dirscan.h when it is included in my IControl file (DatabaseScanner.h):

Severity Code Description Project File Line Suppression State Error C2664 'HANDLE FindFirstFileW(LPCWSTR,LPWIN32_FIND_DATAW)': cannot convert argument 1 from 'const char *' to 'LPCWSTR' (compiling source file ..\QuickFilter.cpp) QuickFilter-vst3 C:\data\iPlug2\WDL\dirscan.h 132

which is followed by:
Severity Code Description Project File Line Suppression State Error C2440 'return': cannot convert from 'WCHAR [260]' to 'const char *' (compiling source file ..\QuickFilter.cpp) QuickFilter-vst3 C:\data\iPlug2\WDL\dirscan.h 175

The weird thing is that it works perfectly fine in IDirBrowseControlBase (I am using it in this project). Is there a macro I’m not defining? What could be causing this?

Thanks in advance

This is a windows-only error, I think related to VST3 (to do with the VST3 SDK). It depends on header ordering I believe.

dirscan.h is included in IControl.h - if you just include that (and not dirscan.h manually) all should be fine.

1 Like