Solved

what are the extensions files possible to active with a object olecontrol

Posted on 2010-09-05
8
352 Views
Last Modified: 2012-05-10
I want to put a image running ( video, power point file, etc ) in a VFP form with a olecontrol field. What are the extensions files possible to active with a object olecontrol?
0
Comment
Question by:luciliacoelho
8 Comments
 
LVL 29

Expert Comment

by:Olaf Doschke
ID: 33607119
Olecontrol has to do with ole (activeX controls), this only is indirectly related to file extensions.

Oleboundcontrol is capable to show ole objects, not directly files. oleboundcontrols are always bound to general fields and you rather should stay away from that.

In regard of the files supported, the help on APPEND GENERAL applies. It says: "FROM FileName
Specifies the file containing the OLE object. You must include the entire file name, including its extension. If the file is located in a directory other than the current default directory, include the path with the file name."

So you can embed files with ole objects in them.

help continunes: "CLASS OLEClassName
Specifies an OLE class for an OLE object other than the default class.

You can specify a class name when the file extension for the file containing the OLE object is different from the default extension and you want to force the behavior for the class. If the default extension can be used by multiple Automation servers, include the class to specify a particular server."

So what you need is an ole automation server associated with the file you want to display. That's not available for any video type for example. Video handling in windows today is not depending on ole automation servers.

You should rather try a different approach than using olecontainer/oleboundcontrol. Better look out for specific ActiveX controls you can embed into your form and redistribute.

Bye, Olaf.
0
 
LVL 41

Expert Comment

by:pcelba
ID: 33607446
Wow, I've started to write the answer then I've been disturbed ... and much better answer is here.

So, I can just agree, it is perfect!
0
 
LVL 27

Expert Comment

by:CaptainCyril
ID: 33609052
What I do in such a case is to create the document in a file and then open it in OLECONTROL (XLS, PPT, DOC, ...). Only MSGraph which I APPEND GENERAL and change its parameters (ChartType, Colors, ...) and then display the OLECONTROL from the General Field.

There are samples in solution.app that ship with FoxPro.

Task Pane/Solution Samples/OLECONTROLS.
0
 
LVL 29

Expert Comment

by:Olaf Doschke
ID: 33609321
Thanks pcelba,

one situation, where olebound control is acceptable is, if you create a cursor and append general to it to temporarily make some ole object available, especially for reports.

In regard to office documents, I rather open the original application with a file for the user to work with. A Doc for example looks odd in an olecontrol, even if you set the backcolor white.

Bye, Olaf.
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 27

Expert Comment

by:CaptainCyril
ID: 33609541
In my applications, I use RTF controls, TreeView, MSGraph, WebBrowser as embedded in forms. I tried working with Excel slapped on a FoxPro form. It needs work and I don't like it when the menu changes.

Regarding Office Documents, they all open in their own applications as Olaf does it.

The best thing to display whether table, document or graphics is HTML inside a Webbrowser control and gives you more of an internet look that a desktop application which almost everybody prefers these days.
0
 

Author Comment

by:luciliacoelho
ID: 33610381
thanks for all the comments.
The CaptainCyril solution is what i prefer now, but how can i creat a webbrowser in a form?ccan you give me a example code?
0
 
LVL 27

Accepted Solution

by:
CaptainCyril earned 500 total points
ID: 33610554
You put an OLECONTROL object on your form and assign "Microsoft Web Browser" or "WebBrowser  Control" when asked.

You have to call the Navigate or Navigate2 command to direct it to a local or internal URL.
Thisform.WebBrowser.Navigate("c:\myhtml\report.html")

Usually in my software I generate HTML files using my own engines: tables, charts, analysis, ... Bottom line they are HTML files.

When you have a WebBrowser on your FoxPro Form, you direct it to that HTML file.

Create a Visual FoxPro Web Browser Sample
http://msdn.microsoft.com/en-us/library/aa979190(v=VS.71).aspx

How To Print Contents of the Web Browser Control from Visual FoxPro
http://support.microsoft.com/kb/265126
0
 
LVL 29

Expert Comment

by:Olaf Doschke
ID: 33613851
You can directly use the webbrowser control. Go to Tools->Options and in the Controls tab of the Options dialog select ActiveX controls. Scroll to Microsoft Web Browser and select it. Set as default and close Options.

All controls selected within the list appear on the ActiveX Controls tab in the form controls toolbar. So choose View->Toolbars and select the form controls. You can also do so when in the form designer or class designer. Only in one of these the form controls toolbar buttons get active. The second button is the "View Classes" button. Clicking it let's you choose a) Add any VCX to display it's classes, b) Standard to get native standard classes or C) ActiveX controls, which then lists all the activeX controls you chose in the options dialog.

Now you can add one of these ActiveX controls to a form or class, like you can with standard controls or any other foxpro class.

Another option is the Toolbox, which does not only host controls or other classes, but also text scraps and more, you can put different stuff into the favorites category, define new categoreis and organize all your own classes, ffc classes, etc. as you like for usage in programming and form/class design. Rightclick on the Toolbox and choose Customize Toolbox to organize the toolbox.

Any way, once you have ActiveX controls on the toolbox or the form controls toolbar you can get it from there to a form.

If you choose the olecontrol you always need to specify which one each time, in the end it's the same, but I rather prefer to drag the control I want instead of using the olecontrol and each time pick one control from the list.

Bye, Olaf.




0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
We have come a long way with backup and data protection — from backing up to floppies, external drives, CDs, Blu-ray, flash drives, SSD drives, and now to the cloud.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

746 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

11 Experts available now in Live!

Get 1:1 Help Now