Board index » delphi » AVI functions and Access Violation Errors...

AVI functions and Access Violation Errors...

Hello all....

Anybody who could help with the following problem.....

I am using AVi function to open and get AVI file Info....I have managed so
far to get all the Functions in a single Unit..

I am trying this in a single unit..., but I am geting ErrorAccess
Violation???????......

procedure TForm1.Button1Click(Sender: TObject);
var MyPFile: PAVIFile ;
filename : PChar;
szFName:  array[0..255] of char;
x: integer;
begin
filename :='sample.avi';

AVIFileInit;

StrPCopy(szFname, 'sample.avi');
AVIFileOpen(MyPFile,szFname, OF_READ, nil);

end;

the functions are declared as follows....

procedure AVIFileInit; external 'AVIFil32' index 15;

function  AVIFileOpen(var pFile: PAVIFile; szFile: PChar;
                          uMode: Word; pclsidHandler: PClsID): LongInt;
                      external 'AVIFil32' index 16;
function  AVIFileInfo(pFile: PAVIFile; var afiInfo: TAVIFileInfo;
                      lSize: LongInt): LongInt; external 'AVIFil32';

Thank you for your help....

Akim.

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet

 

Re:AVI functions and Access Violation Errors...


Quote
Akim Azani <faez...@uce.ac.uk> wrote:
>I am using AVi function to open and get AVI file Info....I have managed so
>far to get all the Functions in a single Unit..

>I am trying this in a single unit..., but I am geting ErrorAccess
>Violation???????......

The only odd thing I see is you have omitted the ".dll" from the "external"
clauses.  You might try changing 'AVIFil32' to 'AVIFil32.dll'.  Beyond
that, I don't see anything obviously wrong.

Have you inserted ShowMessages between each statement to see how far it
gets?  Is it actually the AVIFileOpen which explodes?

- Tim Roberts, t...@probo.com
  Providenza & Boekelheide, Inc.

Other Threads