• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 439
  • Last Modified:

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

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
luciliacoelho
Asked:
luciliacoelho
1 Solution
 
Olaf DoschkeSoftware DeveloperCommented:
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
 
pcelbaCommented:
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
 
CaptainCyrilFounder, Software Engineer, Data ScientistCommented:
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
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
Olaf DoschkeSoftware DeveloperCommented:
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
 
CaptainCyrilFounder, Software Engineer, Data ScientistCommented:
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
 
luciliacoelhoAuthor Commented:
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
 
CaptainCyrilFounder, Software Engineer, Data ScientistCommented:
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
 
Olaf DoschkeSoftware DeveloperCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now