| Ver tema anterior :: Ver tema siguiente |
| Autor |
Mensaje |
Isa1976 Lt Cmdr


Registrado: 23 Nov 2005Mensajes: 104
|
Publicado: Dom 03 Mar, 2019 12:20 pm Asunto: Chromium Embedded Framework en BCB6 |
|
|
Hola a todos,
he estado probando el ejemplo que viene en github https://github.com/lmsp/SimpleCEFDLL
Pero el ejemplo es para C++ Builder 2009, pero he probado en Builder 6 y me da un error en la linea
| Código: |
(*fnCreateBrowser)(Handle, url.c_str() );
|
E2034 Cannot convert 'char *' to 'const wchar_t *'
Pero si la cambio por:
| Código: |
(*fnCreateBrowser)(Handle, static_cast<WideString>("http://www.google.es") );
|
no da errores, compila y ejecuta pero me sale:
raised exception class eaccessviolation with message 'Access violation at address 00000000. Read of addres...
este es el código que tengo
| Código: |
//---------------------------------------------------------------------------
#include <vcl>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init) v
#pragma resource "*.dfm"
TTFormBrowser *TFormBrowser;
typedef void (*SimpleCEFDLL_Initialize)(HINSTANCE);
typedef void (*SimpleCEFDLL_CreateBrowser)(HWND,const wchar_t*);
typedef void (*SimpleCEFDLL_ResizeBrowser)(HWND);
typedef void (*SimpleCEFDLL_Shutdown)(bool);
//---------------------------------------------------------------------------
__fastcall TTFormBrowser::TTFormBrowser(TComponent* Owner)
: TForm(Owner)
{
HINSTANCE hDLL = LoadLibrary("SimpleCEFDLL.dll");
SimpleCEFDLL_CreateBrowser fnCreateBrowser = (SimpleCEFDLL_CreateBrowser)GetProcAddress((HMODULE)hDLL,"SimpleCEFDLL_CreateBrowser");
String url( "http://www.google.es" );
(*fnCreateBrowser)(Handle, url.c_str() );
}
|
| Código: |
//---------------------------------------------------------------------------
#include <vcl>
#pragma hdrstop
//---------------------------------------------------------------------------
USEFORM("Unit1.cpp", TFormBrowser);
//---------------------------------------------------------------------------
typedef void (*SimpleCEFDLL_Initialize)(HINSTANCE);
typedef void (*SimpleCEFDLL_CreateBrowser)(HWND,const wchar_t*);
typedef void (*SimpleCEFDLL_ResizeBrowser)(HWND);
typedef void (*SimpleCEFDLL_Shutdown)(bool);
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
Application->Initialize();
HINSTANCE hDLL = LoadLibrary("SimpleCEFDLL.dll");
SimpleCEFDLL_Initialize fnInitialize = (SimpleCEFDLL_Initialize)GetProcAddress((HMODULE)hDLL, "SimpleCEFDLL_Initialize");
SimpleCEFDLL_Shutdown fnShutdown = (SimpleCEFDLL_Shutdown)GetProcAddress((HMODULE)hDLL, "SimpleCEFDLL_Shutdown");
Application->CreateForm(__classid(TTFormBrowser), &TFormBrowser);
Application->Run();
//(*fnShutdown)(true);
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
catch (...)
{
try
{
throw Exception("");
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
}
return 0;
}
//---------------------------------------------------------------------------
|
Muchas gracias y un saludo a todos!  |
|
| Volver arriba |
|
 |
escafandra Master

Registrado: 29 Nov 2007Mensajes: 625Ubicación: Madrid - España
|
Publicado: Mie 13 Mar, 2019 11:19 pm Asunto: |
|
|
Prueba con esto:
| Código: |
WideString url = "http://www.google.es";
fnCreateBrowser(Handle, url.c_bstr());
|
Saludos. |
|
| Volver arriba |
|
 |
Isa1976 Lt Cmdr


Registrado: 23 Nov 2005Mensajes: 104
|
Publicado: Mie 20 Mar, 2019 9:07 pm Asunto: |
|
|
Hola de nuevo,
te agradezco tu respuesta Escafandra, pero ahora me da Access Violation 000000...
creo que no va a poder funcionar en CBC6
Un saludo! |
|
| Volver arriba |
|
 |
Isa1976 Lt Cmdr


Registrado: 23 Nov 2005Mensajes: 104
|
|
| Volver arriba |
|
 |
Felip Master

Registrado: 09 Jun 2004Mensajes: 200
|
Publicado: Mar 15 Sep, 2020 4:45 am Asunto: |
|
|
| Tengo un ejemplo que se ejecuta en BCB6. El problema es que el componente parece estar desactualizado, ya que el Chrome detecta la versión anterior. |
|
| Volver arriba |
|
 |
Felip Master

Registrado: 09 Jun 2004Mensajes: 200
|
|
| Volver arriba |
|
 |
Isa1976 Lt Cmdr


Registrado: 23 Nov 2005Mensajes: 104
|
Publicado: Jue 17 Sep, 2020 9:13 pm Asunto: |
|
|
Hola Felip,
gracias por tu respuesta, pero al compilar y Build no me da errores, pero al ejecutar me sale "La ejecución del código no puede continuar porque no se encontró MSVCP100D.dll. Este problema se puede solucionar reinstalando el programa"
Un poco extraño. Esa dll es de Visual C++ por lo que tengo entendido.
Un saludo! |
|
| Volver arriba |
|
 |
|