Solved

Flash Active X: Installed?

Posted on 2002-03-26
7
179 Views
Last Modified: 2010-04-04
All -

I have Delphi 6 and I have successfully imported the Flash OCX into my application. Later I will burn my application on CD, containing the swf file. Since some machines may not have the Flash player, I will be including the installation for the Flash payer on the CD-ROM (I got this from Macromedia's web site). I need a try and except (or a try...finally) routine, but I'm not sure how to do this.

In this routine I need it catch the (any) error and prompt "Flash not found, do you want to install the player?"

If you have the code, that would be great. If you have a sample site, that would be good too. Right now - this is what I have:

program MyProgram;

uses
  Forms,Dialogs, comobj, windows, classes, sysutils,
  main in 'main.pas' {Form1},
  about in 'about.pas' {AboutBox};

{$R *.res}
begin
 Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TAboutBox, AboutBox);
  Application.Run;
end.

TIA-

Jim
0
Comment
Question by:JPersinger
  • 3
  • 3
7 Comments
 
LVL 6

Expert Comment

by:DrDelphi
ID: 6896980
Create a dummy file and check for an associated Executable... like this:

{uses ShellAPI)
Function IsFlashInstalled:Boolean;
var ret:array[0..255] of char;
begin
 try
   result:=false;
   filecreate('C:\dummy.swf'); //create a dummy file
   FindExecutable('c:\dummy.swf',nil,ret); //find the associated EXE
   result:=ret<>'';
 finally
   DeleteFile('C:\dummy.swf'); //clean up your mess!!
  end;
end;


if IsFlashInstalled then yada, yada...



good luck!!
0
 
LVL 9

Accepted Solution

by:
ginsonic earned 100 total points
ID: 6897105
Read this article :

Displaying Macromedia Flash .SWF files in your Delphi Application

http://www.delphipages.com/news/detaildocs.cfm?ID=38

Anothers interesting links there .
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 6897121
This article show how can include SWFLASH.OCX into your exe file . When start into a new system, the application will detect if the ocx is registered or not .
If not, will register for you ... now your program will work with no problems.
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:JPersinger
ID: 6897314
Hum - I found the code that was similar to this one, but didn't go into as much information. One thing that is intresting is -

""SWFLASH.OCX" usually in the C:\Windows\System\Macromed\Flash directory " indicates its a win95 or win98 machine. Also, the OCX for Flash 6 is called Flash.ocx. So when I applied the code that was from a different site, the file always failed.

I'll try this one and let all know.

Thanks

Jim

0
 

Author Comment

by:JPersinger
ID: 6897944
The web page has been written well. Thanks for the info. I made some modifications to the code because I'm using Flash 6 and it was written for Flash 5, but other than that it work perfectly.

Thanks

Jim
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 6898462
Glad to help you ;)
0
 

Author Comment

by:JPersinger
ID: 6900194
I failed to test the app on a Win98 machine. The file failed to display my flash even though the flash ocx showed up in the right location on th etarget machine. I performed a manual registration and the flash file worked. I then un-registered the file, removed it, and used my app again. It failed a second time. So I ran the installed from Macromedia that was available through download, and it too failed to install the OCX right. The only proved method on two Win98 machines was to manually register the OCX and then everything worked perfect.

On Win XP (Home version), Win NT, Windows 2000, and Onc ewindows 95 (version c) did the app do find.

No problem, however, I put a disclaimer on the CD-ROM before handing them out. :)

Thanks again -

 Jim
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Convert Jpg /PNG To GIF 5 150
Delphi - replicating a form 8 81
Delphi Mdi application Child forms get behind control 7 270
How to define IfThen functions in one common unit? 4 60
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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

856 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