Where is the documentation for TWebBrowserEx in Delphi XE? - delphi

I just discovered TWebBrowserEx in the Delphi XE source. When I google it, I get zero hits! Anyone have insight on where this component came from, and on what the purpose is?

You can find the source in $(BDS)\Source\Internet\WebBrowserEx.pas. If you open that file, there is a large section of comments at the top giving links to the documentation for the interfaces inside.

The component is usually called TWebBrowser – no doubt this is a variant. Perhaps they renamed it to avoid clashes with existing TWebBrowser components.
TWebBrowser is an OCX wrapper around IWebBrowser2. It's very hard to imagine that TWebBrowserEx is implemented in any other way.
The documentation is on MSDN but you'll get better hits searching for TWebBrowser. The best source of information is Brian Cryer's site.
Note that once you get into programming the DOM (through the Document property) it becomes highly dynamic and so what documentation there is takes quite a bit of getting used to if you are used to more static class interfaces.
UPDATE
According to #jachguate, TWebBrowserEx derives from TWebBrowser and adds a bunch of extra interfaces. I don't believe this changes anything substantial in the answer. The documentation sources are still going to be as listed above.

The one that is installed into the IDE for use at designtime is called TWebBrowser, and it is implemented in SHDocVw.pas.
I thought there is no such class name as TWebBrowserEx in any file in Delphi XE VCL source folder. What file are you looking at and where is it located?
You might be interested in the TEmbeddedWB component from www.bsalsa.com. I found that it works a lot better for me than the standard TWebBrowser.
Update: So it does exist. Whoa. It seems to be an inner class defined inside this unit, used as a field inside TCustomWebBrowserComponent, which seems to be a base class you would extend.

Related

Is there a way that I could see the codes behind a visual and non-visual component?

I was just wondering if there is a way that I could go down to the codes of a component (visual or non-visual)? It would be a great relief for a coder to understand how a component behaves in the back-end. Perhaps, a coder could do some changes or add complementary codes to fit its requirement.
If your Delphi includes the source code then its easy.
Switch to the unit of the form that includes the component
Go to the declaration of the component, right-click on the the component's type and the click on Find Declaration
And there you go, the component's code.
Now you can Find Declaration on the ancestor, in this case TCustomPanel and see how the ancestor is made.
There are many resources explaining how they all fit together and many on how to create components. Once you understand classes and this whole Object Orientated thing then you will find it easier.
I started creating components long ago and by looking at the source code of other components I learned so much. I still do.

delphi integrate custom file editor into IDE

I have deveoped a custom file type, together with a custom editor (basically a tree with several data pages attached and a few extra buttons). OK, I can run it stand alone and that is fine, and even add it to the tools menu, but I would like to integrate it into the Delphi IDE so that my custom editor (or a similar new version) appears in the IDE, rather like a DFM file has a custom editor. I can find references to most extensions in the Delphi IDE, but not this one. Any guiding hands? Note that this is not a property or component editor (the file type has nothing to do with either of these) nor is it simply syntax highlighting of a text file.
AFAIK it currently isn't possible to reliably integrate a custom editor into the Delphi IDE. The required API simply isn't there. See QC89028 Custom Module support.
During the Delphi 2010 and XE betas I spent most my spare time trying to get a resource editor integrated. Although the effort had the official blessing of Embarcadero and got some, half hearted, support from the IDE engineer, I was never able to get them to deliver on their promises and surface the module API. I eventually abandoned the project.
Update: I've now checked my old correspondence regarding this and it turns out part of the problem was that IOTAModuleCreator (used to implement File|New for custom file types) and IOTAEditorContent (used to transfer data to/from the custom module) only supports text data. Binary data gets mangled.
You can probably do this via an IDE plugin that uses the ToolsAPI (see ToolsAPI.pas in the IDE's source folder (e.g. Program Files (x86)\Embarcadero\Studio\source\ToolsAPI\ToolsAPI.pas.)
For information on writing a plugin in general, see David G Hoyle's excellent blog. Once you know the basics - i.e., write a 'wizard' and get it to do something - you will need to work on integrating your editor.
I have never done this, and so I can't guarantee it is possible. However, some interfaces that look worth investigating and implementing are INTACustomEditorView, which represents a 'view' (file tab when that file is open - think the code editor, Welcome view, type library editor, etc) and IOTAEditorViewServices, to register your custom view. I do not know how you associate a view type with a file type, sorry - possibly something to do with the personality interfaces. You might also be interested in INTACustomEditorSubView which is what creates a tab on the bottom of a file.
Good luck, and if you find a solution please write here so that other people can learn too!

How do you fix "Could not load unit UnitName symbol information for TClassName. Do you want to try to find this file yourself?"

In delphi, creating ActiveX controls was something that was once more popular than it is now. However it remains possible to create ActiveX controls with Delphi. This question assumes Delphi 2007, but it should be the same no matter what Delphi version you use.
There are some strange errors in Delphi when you create ActiveX controls. IN my case, I can
now no longer import a certain class that I am trying to import and wrap, and Delphi won't tell me why any more, just that it could not load the unit "symbol information".
In this case, I am wrapping an open source control, and my first few attempts to wrap it worked fine, but I found that I had to redo the import once I found properties that were written in a way that the ActiveX wrappers were missed. It's easier to regenerate an ActiveX wrapper than to fix it by hand. Until you get stopped cold like this:
Error
Could not load unit [unit] symbol information for [TClassName].
Do you want to try to find this file yourself?
If I click Yes, I get a browse (file open) dialog and it has the file filter set to "DCU". Which means, it wants me to find the DCU file for this unit. If I browse to it, or if I don't, the results are the same. No amount of recompiling will clear this error condition.
does anyone know what this error really means, and better yet, how to fix it? Googling this particular error message shows it comes up in forums other than English, but is so obscure nobody has yet documented it.
There is an issue with the Library Path in Delphi, that for the ActiveX Control wizard to work properly, all sources needed for the parser to parse the unit in question must be in the library path. Since the ActiveX control wizard functions outside your project, your project search paths are NOT included in the list of folders that are used to parse the sources of the VCL control that is to be wrapped and turned into an ActiveX Control.
Solution:
Fix the library path.

What does TDataModule.ClassGroup pseudo-property in Delphi XE2 really do?

I tried to copy and paste a component from one data module into another in Delphi XE2. The component was a Fast Report data source link component. The data module was brand new, just created that second, in XE2.
Someone else had the same problem and reported it on quality central as 106369 and same error message leading me to this mysterious DocWiki entry.
So data modules now have a framework affinity, and a designtime-only pseudo property, which according to the docs:
"Because the ClassGroup pseudo-property is used only by the IDE and is not a compiler-generated property (hence, 'pseudo-property'), ClassGroup is not documented in the compiler-generated Libraries Reference. The page you are reading is the documentation for ClassGroup."
So, the first time I even learn this exists is when it blocks me from copy and pasting components into my data module from an existing set of designtime building blocks that I didn't wish to rebuild from scratch.
Once I change the data module affinity, I can paste stuff into data modules without it bugging me. Thank goodness for Google-that-error or I'd be stuck.
If it is intended to help us write cross platform data modules, and yet it only affects the IDE, according to the documentation, that's inconsistent with the warning that you get when you play with this at designtime, here's the error you get if you change it:
EInvalidType : The following component(s) are not available in the specified
class group. This is likely to cause compile or runtime errors.
frxDBSet.TfrxDBDataset.
What I can't see is how that error message can be correct, and the documentation can also be correct.
The warnings seem to suggest compile, link, and runtime errors if this is set incorrectly. Curious minds who want to know what's really going on, want to know: What is this thing about and why did it get added to the data modules in XE2. I anticipate other people will stumble upon this weird feature, with the feeling that they've stepped in something like dinosaur droppings, and want to know what is up with this feature.
My best answer at this point is that a data module affinity for TPersistent which means, in XE2 lingo, that this data module doesn't want non-visual controls in it, that are VCL-specific. In a future version of Delphi, perhaps a similar marker would allow us to mark forms as being "clean of dependencies on the VCL or windows" too?
Update 1: The .PAS source code of your data module stores this pseudo-property in a way that looks a bit like a compiler directive, like this:
implementation
{%CLASSGROUP 'Vcl.Controls.TControl'}
I think it is pretty obviously what its intended use is for, and the documentation you link to is pretty extensive about that purpose.
It is meant to prevent VCL-only components from being placed on a FireMonkey-accessible DataModule, and vice versa.
Since TDataModule is initially framework-neutral, only framework-neutral components can be placed on it.
So obviously, your source DataModule has a different affinity than your new DataModule, which is why copy/paste does not work until you change the affinity of the new DataModule to match the affinity of the source DataModule.

Full VCL Class Browser for Delphi

Remember the old class hierarchy posters that used to come w/Delphi?
I'm wanting a full class hierarchy browser for ALL my Delphi classes, including the custom ones I've built and installed on the palette, plus third-party components. Ideally easily searchable by class name (including "whole word only" searches, so partial matches don't count).
I've only seen two things that come close:
1) GExpets Class Browser - Works great, BUT doesn't automatically load ALL installed components / classes, which is what I want. You have to import all the source units manually, as far as I can tell.... which can be quite a hassle. It also doesn't allow "whole word only" searches, so sometimes searching for a class w/a common "sub name" takes forever.
2) Eagle / DevExpress CDK - It loads the full class list automatically, and seems to work brilliantly, but it's only usable in D7 and prior, and it's not really focused on being a class browser per se, so much as an "inherit from" chooser.
Is there anything out there which does this already? If not, how difficult would it be to write an app that, at bare minimum, builds a self-referencing class-name table, so I could at least throw it into a database / treeview component to easily view inheritance / ancestry, etc.?
I think ModelMaker Code Explorer has this feature, but I don't use it
ESSModel is another nice class browser tool, and it's open source. I don't know if there's any way to get it to load a list of units automatically. Not sure, but you may be able to manually import all the units you want and then save that as a base project that you start from with all your individual projects. Not sure how performance would be with that much loaded, or how easy it to view the part(s) you want.
http://essmodel.sourceforge.net/
Assuming you need a Delphi IDE Expert (you've mentioned somewhere in your post: "...installed on the palette, plus third-party components"), DelphiDiver is good for you (Source code available on the DelphiPraxis, registration needed).
Look and feel:
If you feel like delving into the IDE in order to get more indepth details, click Inspect the IDE hence the name of the Expert (DelphiDiver) ;-)
Click Inspect the Packages so as to browse any other third party component(s) or whatever package(s)/component(s) you've installed.
It makes use of the advanced RTTI and requires Delphi 2010 version onward.
I've personally installed it using Delphi XE on my box.
I hope it can serve as a base for the more focused Full VCL Class Browser you are looking for.

Resources