Hello,
Has anyone had any success creating a Win32 application using TMSWebBrowser with XE6 and C++?
I've followed the instructions in the "winsupport.txt" file but my results are always the same. The compiled application works in Delphi (IOS and Win32) and C++ (IOS Only). No errors are generated in the Win32 application but the component acts as if it's "Visible" property is set to false. I don't even get an error when not including the required ChromiumFMX files from the 'lib' folder.
I've tried installing TMS Pack for FireMonkey on three separate computers and all have the same results.
Any suggestions or ideas?
Thanks
Hi,
For C++ Builder you will need to re-compile the package TMSFMXPackPkgDXE6 for the Win32 platform target in Delphi so it generates C++ Builder compatible files after following the instructions in winsupport.txt.
Kind Regards,
Pieter
Can you open and recompile the ChromiumFMX package with generate all C++Builder files?
When I recompile ChromiumFMX, the following files are created in the same folder as their associated .pas files inside the main 'ChromiumFMX' folder.
ceferr.hpp
ceffmx.hpp
cefgui.hpp
ceflib.hpp
plus these in the same location
ChromiumFMX.hpp
ChromiumFMX.res
The files below are created in the 'Win32 \ Debug' folder
ceferr.dcu
ceffmx.dcu
cefgui.dcu
ceflib.dcu
Am I missing some files required for C++ or do I have to specifically reference something else in my C++ project?
Thanks.
Hi,
Yes, as shown below, it created the file 'FMX.TMSWebBrowser.Win.hpp' in the 'Win32' folder and 'FMX.TMSWebBrowser.Win.dcu' in the 'Release' subfolder.
I don't see any reference to the ceffmx and ceflib units inside this machine generated header file. Could that be the cause of the problem?
Thanks,
// CodeGear C++Builder
// Copyright (c) 1995, 2014 by Embarcadero Technologies, Inc.
// All rights reserved
// (DO NOT EDIT: machine generated header) 'FMX.TMSWebBrowser.Win.pas' rev: 27.00 (Windows)
#ifndef Fmx_Tmswebbrowser_WinHPP
#define Fmx_Tmswebbrowser_WinHPP
#pragma delphiheader begin
#pragma option push
#pragma option -w- // All warnings off
#pragma option -Vx // Zero-length empty class member
#pragma pack(push,8)
#include <System.hpp> // Pascal unit
#include <SysInit.hpp> // Pascal unit
//-- user supplied -----------------------------------------------------------
namespace Fmx
{
namespace Tmswebbrowser
{
namespace Win
{
//-- type declarations -------------------------------------------------------
//-- var, const, procedure ---------------------------------------------------
extern DELPHI_PACKAGE void __fastcall RegisterWebBrowserService(void);
extern DELPHI_PACKAGE void __fastcall UnRegisterWebBrowserService(void);
} /* namespace Win /
} / namespace Tmswebbrowser /
} / namespace Fmx */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_FMX_TMSWEBBROWSER_WIN)
using namespace Fmx::Tmswebbrowser::Win;
#endif
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_FMX_TMSWEBBROWSER)
using namespace Fmx::Tmswebbrowser;
#endif
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_FMX)
using namespace Fmx;
#endif
#pragma pack(pop)
#pragma option pop
#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif // Fmx_Tmswebbrowser_WinHPP
When removing the conditional define, it should regenerate a hpp file with references to cef units.
I've tried your suggestion of removing the .hpp file and manually rebuilding in Delphi but the result is the same. The regenerated .hpp file does not include the references to the cef units.
Also tried commenting out the $IFDEFs and simply using the following but no luck there either.
uses
Classes, FMX.Types, FMX.Platform, FMX.TMSWebBrowser, ceflib, ceffmx;
The Delphi Compiler setting "C/C++ Output FIle Generation" is correctly set to "Generate all C++Builder files (including package libs)"
Anything else I could check?
Also, do you compile your application with the option to NOT use runtime packages?
Resolved !!!
The TMSWebBrowser control definitely works in C++ but not simply by using the installer and following the instructions in 'winsupport.txt'. For example, neglecting to disable "Link with runtime packages" as you mentioned can cause issues. Also had to play with the "Build control" setting under "Project\Options\Description" of the ChromiumFMX package and resave to get past some errors when compiling TMSFMXPackPkgDXE6.
If OSX support is needed, then compiling TMSFMXPackPkgDXE6 with OSX as the target must be done first and before commenting the line {$DEFINE CHROMIUMOFF}. Failing to do so will cause problems and interfere with OSX compilation as the unnecessary ChromiumFMX package will be included under the 'Requires' section.
Anyway, I can finally compile using the TMSWebBrowser control in Delphi and C++ for both Windows and OSX. Thanks for your help.