Solved

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

Posted on 2010-09-05
8
399 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
[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
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 42

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
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
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
 
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 our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

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…
Gain an elementary understanding of Blockchain technology.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

705 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