Solved

Flash Active X: Installed?

Posted on 2002-03-26
7
170 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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

760 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

17 Experts available now in Live!

Get 1:1 Help Now