Thank you both very much for your quick replies.
Monster: Ive used that before, but it causes massive errors in some AVI DLL other than VFW. The segment of code works perfectly, until I add a class to the program. As soon as the class is there, the 2nd parameter barfs.
xds4ls: Im quite stale at programming, so I have tried to look up what you mean by 'just try to do the cast'. Ive been stuck on this problem C2664 for a week now, and Ive done lots of research. I just dont understand how the code has no problems when its run in a program without classes, and wont work with classes.
Sorry about not posting the code as its supposed to, but it wouldnt let me use the tags as unregistered.
I thought that maybe I needed to call a vfw class in front of the function as below, but this doesnt help.
I also tried the following, where I didnt pass the text into a variable:
vfw::AVIStreamOpenFromFile(&pavi, szFile, streamtypeVIDEO, 0, OF_READ, NULL) //tried using stdapi:: and vfwapi:: in place of vfw:: - no success.
This too gives an invalid 2nd parameter, BUT ONLY in a program where I have a class in the header file.
LPCSTR szFile="test.avi"; // Also tried using LPCTSTR
AVIStreamOpenFromFile(&pavi, szFile, streamtypeVIDEO, 0, OF_READ, NULL);