Reputation: 1187
Using VS2017 I compile the code below using the unicode character set
STDMETHODIMP Load(LPCOLESTR lpwszFileName, const AM_MEDIA_TYPE *pmt) {
TCHAR *szExtension = PathFindExtension(lpwszFileName);
and I get the following error
error C2664: 'LPSTR PathFindExtensionA(LPCSTR)': cannot convert argument 1 from 'LPCOLESTR' to 'LPCSTR'
The same code under VS2008 compiles just fine. What seems to be to problem here and why the compiler chooses the ANSI version of the PathFindExtenstion instead of the unicode one ?
Upvotes: 0
Views: 2971
Reputation: 1187
The problem was that the VS2017 variable
%(PreprocessorDefinitions)
was missing from Preprocessor Definitions. Now the definers /D _UNICODE and /D UNICODE are added correctly to the compiler parameter's list.
Upvotes: 0