Cannot open avi

Posted on 2005-04-28
Last Modified: 2012-08-14
Hi Expert,

When I run the .exe file of my delphi program on a different XP computer than the one which is my XP development environment, an avi-component I copied from the net (search.avi size 49,884 bytes; size on disk 50,176 bytes; coded as ani_search: TAnimate), is not shown. Instead, the message "cannot open avi" is shown and the program hangs.

What is wrong and how to solve this?

Ron dW
Question by:Ron_de_Weijze
    LVL 15

    Accepted Solution

    Is the path to your avi correct within your application and not something like a local directory you were testing on.

    Author Comment

    Thanks Mike,

    Which path should be set to the avi file? Environment variables: APPDATA, CommonProgramFiles, DELPHI, HomePath, Path, ProgramFiles, TEMP, TMP; Library directories: Library Path, BPL output, DCP output, browsing path; Project option directories: output directory, unit output directory, search path, debug source path or conditionals? I don't see the forest for the trees...

    Ron dW

    Author Comment

    I put the avi between the resource files and linked the ani_search Filename to it. At least the errormessage is gone now. Therefore it must have been so, as you suggested Mike, that all along the error was automatically 'resolved' on my own machine because the file could be found after compilation, which of course is not the case at the other machine.

    Case closed.

    Author Comment

    Case reopened.

    Thought I had the problem reproduced on my machine, but still, when the avi is copied into the directory where all the resource files are, the compiled and exe versions show the error on the other machine.

    So I would still like to know which path needs to lead to the avi file to have it compiled and put in the executable.

    Ron dW
    LVL 15

    Expert Comment

    Sorry about the slow response Ron_de_Weijze, my last message was just before I switched my PC off.

    Ok usually you keep all your files that go along with your application in the same folder.
    To keep all paths to resources you usually use the command

    ExtractFilePath(Application.ExeName) + <YOURFILENAME>

    This way, wherever your application is located, you will always point to any other resource files you need if they are in the same folder on the PC.

    Hopefully this is of use to you.


    Author Comment

    Hello Mike,

    Think I found the problem. Installshield writes the executable to a directory that must be empty. Before installing, the previously installed program therefore needs to be removed with "add or remove program". This however, did not remove the executable. Haven't found out why yet. If I remove it manually and then install, then the correct, latest, executable is put there. And the avi file is found!

    So the solution was right the first time around. It was the installation and the testing thereof that went wrong.

    Thanks and have a good weekend.

    Ron dW

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
    Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now