Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Cannot open avi

Posted on 2005-04-28
Medium Priority
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
  • 4
  • 2
LVL 15

Accepted Solution

mikelittlewood earned 1000 total points
ID: 13887308
Is the path to your avi correct within your application and not something like a local directory you were testing on.

Author Comment

ID: 13887400
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

ID: 13888136
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.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 13888821
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

ID: 13892575
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

ID: 13895173
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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

571 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