Im trying to write code that reads AVI file information. I use vfw.h
The code is something like this:
code:
void OpenAVI(LPCSTR szFile); //declaration in header
-munch-
OpenAVI("test.avi"); // Calls function with filename in main
-munch-
void OpenAVI(LPCSTR szFile) // Opens avi file
{
AVIFileInit();
AVIStreamOpenFromFile(&pavi, szFile, streamtypeVIDEO, 0, OF_READ, NULL) ; // barfs on 2nd param
}
end code:
Here is the compiling error:
error C2664: 'AVIStreamOpenFromFileW' : cannot convert parameter 2 from 'const char *' to 'const unsigned short *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
When I dont use classes in the header, this code compiles fine without a function declaration, however, with a class in the header, I get this error. Thank you for any help.
-David



LinkBack URL
About LinkBacks




