Solved

Flash Active X: Installed?

Posted on 2002-03-26
7
180 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
Independent Software Vendors: 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

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

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!

Question has a verified solution.

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

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…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

762 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