?
Solved

Flash Active X: Installed?

Posted on 2002-03-26
7
Medium Priority
?
184 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 400 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month11 days, 14 hours left to enroll

752 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