Solved

Flash Active X: Installed?

Posted on 2002-03-26
7
176 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
ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

 

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

810 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