secondstory / ofxDSHapVideoPlayer

ofxDSHapVideoPlayer is a Hap video player addon for openFrameworks (Windows-only)
Other
37 stars 21 forks source link

LPCTSTR error when using ofxOsc with ofxDSHapVideoPlayer #17

Closed diemildefreude closed 1 year ago

diemildefreude commented 1 year ago

I’ve never had this problem using ofxOsc with other projects. And ofxDSHapVideoPlayer hasn’t thrown this error until now. But something about having them both in the same project throws this error:

Severity | Code | Description | Project | File | Line | Suppression State -- | -- | -- | -- | -- | -- | -- Error | C2664 | ‘CVideoTransformFilter::CVideoTransformFilter (LPCTSTR,LPUNKNOWN,const IID &)’: cannot convert argument 1 from ‘const wchar_t [28]’ to ‘LPCTSTR’ | example | C:\Users\selli\openFrameworks\addons\ofxDSHapVideoPlayer\src\DSUncompressedSampleGrabber.cpp | 20 |   ![image](https://user-images.githubusercontent.com/16056630/194281080-cd021400-d2f9-46cf-84ae-c7583ccdde31.png) which is weird, because it looks like the argument being given there is indeed in the LPCTSTR format (prefixed with an L). I’m able to replicate this error easily by just adding ofxOsc to ofxDSHapVideoPlayer’s example project in the Project Generator. I’m on Windows 10 using Visual Studio 2019
diemildefreude commented 1 year ago

OK, fixed this by changing

CVideoTransformFilter(FILTERNAME, (IUnknown*)pOuter, CLSID_SampleGrabber)

to

CVideoTransformFilter((LPCTSTR)FILTERNAME, (IUnknown*)pOuter, CLSID_SampleGrabber)

Not sure why having osxOsc in the project causes this, but super happy to find a fix.