Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > C++ Builder
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #4  
Antiguo 05-06-2017
lago lago is offline
Miembro
 
Registrado: nov 2015
Posts: 40
Poder: 0
lago Va por buen camino
Completo con lo que faltaba que es poder ejecutar funciones JavaScript y que he encontado por ahi y rula

Código:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
 IHTMLDocument2  *doc = NULL;
  IHTMLWindow2 *win;
  if(SUCCEEDED(WebBrowser1->Document->QueryInterface(IID_IHTMLDocument2, (LPVOID*)&doc)))  {
	HRESULT hr = doc->get_parentWindow(&win);
	if (SUCCEEDED(hr))  {
	  BSTR cmd = L"ClearMarkers()";
	  VARIANT v;
	  VariantInit(&v);
	  win->execScript(cmd,NULL,&v);
	  VariantClear(&v);
	  win->Release();
	}
	doc->Release();
  }
Y función con parametros:

Código:
void __fastcall TForm1::Button2Click(TObject *Sender)
{
  IHTMLDocument2  *doc = NULL;
  IHTMLWindow2 *win;
  if(SUCCEEDED(WebBrowser1->Document->QueryInterface(IID_IHTMLDocument2, (LPVOID*)&doc)))  {
	HRESULT hr = doc->get_parentWindow(&win);
	if (SUCCEEDED(hr))  {
	  String str = String("GotoLatLng(") + Edit1->Text + "," + Edit2->Text + ")";
	  VARIANT v;
	  VariantInit(&v);
	  win->execScript( str.w_str(), NULL, &v );
	  VariantClear   ( &v );
	  win->Release   ();
	}
	doc->Release();
  }
}
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Api de google , google maps en c++ builder 6 JM1985 C++ Builder 1 01-04-2016 21:10:17
GPS y Google Maps MAXIUM Internet 5 15-03-2011 18:15:05
Google Maps madiazg Varios 4 26-10-2008 22:03:41
Google maps y php halizia PHP 2 16-03-2007 17:04:49
Google Maps .es Neftali [Germán.Estévez] Noticias 0 27-04-2006 13:32:54


La franja horaria es GMT +2. Ahora son las 02:25:23.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi