Discussion:
why AVIFileOpen error on XP sometimes ?
(too old to reply)
nacyhwx
2004-05-25 10:34:58 UTC
Permalink
Hi
I use AVIFileOpen(&pfile,(char*)aviFileName ,OF_WRITE| OF_CREATE, NULL);
to open or create a avi file in my program . it works well on windows
98/2000 and on clean XP platform. but when i install much software on my XP
, AVIFileOpen will return an error result . what happened ? and how can
i solve it ?

AVIFileOpen(...) return -2147221008 .

it is so strange . in a general way , if some other program had opened the
avi file ,
it return AVIERR_FILEOPEN ( -2147205009 ).
it work well on 98/2000 and clean XP . i use these library : winmm.lib and
vfw32.lib .
thanks a lot .

thanks .
enlone .
Alexander Grigoriev
2004-05-25 19:35:49 UTC
Permalink
If you want to read a file, specify OF_READ.
If you want to create or overwrite a file, and another program keeps the
file opened, you cannot do it.
Post by nacyhwx
Hi
I use AVIFileOpen(&pfile,(char*)aviFileName ,OF_WRITE| OF_CREATE, NULL);
to open or create a avi file in my program . it works well on windows
98/2000 and on clean XP platform. but when i install much software on my XP
, AVIFileOpen will return an error result . what happened ? and how can
i solve it ?
AVIFileOpen(...) return -2147221008 .
it is so strange . in a general way , if some other program had opened the
avi file ,
it return AVIERR_FILEOPEN ( -2147205009 ).
it work well on 98/2000 and clean XP . i use these library : winmm.lib and
vfw32.lib .
thanks a lot .
thanks .
enlone .
nacyhwx
2004-05-26 01:37:07 UTC
Permalink
i just want to know why i can't create avi file on some XP (which maybe had
installed many program ) and it return this value (-2147221008 ).

i can create it on 98/2000 and clean XP and some XP which install some
program .

enlone
Tim Roberts
2004-05-26 06:22:33 UTC
Permalink
Post by nacyhwx
I use AVIFileOpen(&pfile,(char*)aviFileName ,OF_WRITE| OF_CREATE, NULL);
to open or create a avi file in my program . it works well on windows
98/2000 and on clean XP platform. but when i install much software on my XP
, AVIFileOpen will return an error result . what happened ? and how can
i solve it ?
AVIFileOpen(...) return -2147221008 .
it is so strange .
You should print COM error numbers in hexadecimal. -2147221008 is
0x800401F0, which is CO_E_NOTINITIALIZED. Do you call CoInitialize or
CoInitializeEx?
--
- Tim Roberts, ***@probo.com
Providenza & Boekelheide, Inc
nacyhwx
2004-05-27 02:32:35 UTC
Permalink
Post by Tim Roberts
You should print COM error numbers in hexadecimal. -2147221008 is
0x800401F0, which is CO_E_NOTINITIALIZED. Do you call CoInitialize or
CoInitializeEx?
--
Providenza & Boekelheide, Inc
CoInitialize ? I had used AVIFileInit() before AVIFileOpen(...) ,
MSDN : The AVIFileInit function initializes the AVIFile library.
Do me need some else operation ?

Is AVIFileInit() can't work well on some XP ? (Just some XP !!!)
Tim Roberts
2004-05-28 05:19:18 UTC
Permalink
Post by nacyhwx
Post by Tim Roberts
You should print COM error numbers in hexadecimal. -2147221008 is
0x800401F0, which is CO_E_NOTINITIALIZED. Do you call CoInitialize or
CoInitializeEx?
CoInitialize ? I had used AVIFileInit() before AVIFileOpen(...) ,
MSDN : The AVIFileInit function initializes the AVIFile library.
Do me need some else operation ?
Every program that uses COM needs to call CoInitialize (or CoInitializeEx),
usually as one of the very first things in your program. AVIFileInit does
not call it automatically -- your program must do so.
Post by nacyhwx
Is AVIFileInit() can't work well on some XP ? (Just some XP !!!)
It works fine on XP.
--
- Tim Roberts, ***@probo.com
Providenza & Boekelheide, Inc
nacyhwx
2004-05-28 09:37:25 UTC
Permalink
thanks all .

i should use CoInitialize before .

Loading...