Thanks for the tips! Using those, I was able to get rvHtmlViewImporter to work.
Thanks for explaining where the Explicit Rebuild option was set -- I could not find that before, and did not think to look under "Description" (which is not really what a "Build Option" is). Explicit Rebuild was set as the default for these new C++ Builder Projects, so I did not have to change it.
I did not mean to imply that "Generate all C++ files" would allow the components to work under both Delphi and C++. If you know how to get the components to work under both Delphi and C++ in RAD Studio, I hope you will tell me.
The "Install | Component" technique has flaws under C++ (it works a lot better with Delphi than C++ Builder), because it starts the build before you have finished the options, and when it hits a problem, it just fails. Under Delphi, it actually fixes the problem and restarts the build.
Using branch/11 instead of trunk, the sample Hello World project for THtmlViewer no longer needs to use WideString, just:
Code: Select all
HtmlViewer1->LoadFromString("Hello");
Notes for anyone finding this post in the future (including me, the next time I have to upgrade):
For those of us who don't use svn, you can check what branches are available with
Code: Select all
svn list http://thtmlviewer.googlecode.com/svn/branches
Branch 11 is the only one at this writing.
At this time (17 Jul 2011), the latest revision in branch/11 is r171 from 3 Apr 2011, which worked.
To see what revisions are available for a branch:
Code: Select all
svn log (branch name, or . if you have checked out a branch) | less
I found the RVPkgCBXE.bpi in C:\Users\Public\Documents\RAD Studio\8.0\Dcp
As you had noted, the TRichView source directory needs to be added to the library path, for RVTable.res (and others)
The C++ version of Hello World for RVHtmlViewImporter is:
New C++ Project, drop a TRichViewEdit, TRVStyle, TRVHTMLViewImporter, and a THtmlViewer on the form. In the FormCreate:
Code: Select all
RVHTMLViewImporter1->HTMLViewer = HtmlViewer1;
RichView1->Style = RVStyle1;
HtmlViewer1->LoadFromString("Hello");
Create a button, and for its click handler:
Code: Select all
RVHTMLViewImporter1->ImportHtmlViewer(RichView1);
RichView1->Format();
Start the program. You should see "Hello" in the HTMLViewer. Click the button, and you should see "Hello" in the RichViewEdit. If you get an access violation when you click the button, you forgot to hook up the TRVStyle component.