![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#2
|
|||
|
|||
|
al final me dieron la solución:
<CODE> pedef std::map<CComVariant, CComBSTR> MapField; MapField mf; mf["A010101"] = L"43000000K"; // primeros dos campos del form mf["A010102"] = L"nombre y apellidos"; // "web" es TCppWebBrowser CComQIPtr<IHTMLDocument2> doc(web->Document); // Obtenemos la lista de frames CComPtr<IHTMLFramesCollection2> frames; doc->get_frames(&frames); // long numFrames; frames->get_length(&numFrames); // De la lista seleccionamos el frame con su nombre CComVariant frameDisp; OleCheck(frames->item(&CComVariant("nombreDelFrame"), &frameDisp)); CComQIPtr<IHTMLWindow2> frame(frameDisp.pdispVal); // Obtenemos el documento de dicho frame CComPtr<IHTMLDocument2> docFrame; frame->get_document(&docFrame); // Seleccionamos el form a rellenar con su nombre CComPtr<IHTMLElementCollection> forms; docFrame->get_forms(&forms); CComPtr<IDispatch> disp; HRESULT hr = forms->item(CComVariant("nombreDelFormARellenar"), CComVariant(), &disp); if (SUCCEEDED(hr) && disp) { CComQIPtr<IHTMLFormElement> form(disp); CComQIPtr<IHTMLInputElement> field; for (MapField::iterator ite = mf.begin(); ite != mf.end(); ite++) { disp = 0; if (SUCCEEDED(form->item(ite->first, CComVariant(), &disp)) && disp) { field = disp; field->put_value(ite->second); } } // form->submit(); } </CODE> Última edición por mns fecha: 15-05-2011 a las 21:34:46. |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Rellenar con 0.... | buitrago | Varios | 6 | 17-11-2011 20:02:53 |
| Rellenar Formulario Web a través de Delphi | Cecil | Internet | 2 | 04-08-2008 09:50:15 |
| ¿Es posible cerrar automaticamente un formulario en delphi? | mabjes | OOP | 7 | 13-07-2007 17:47:26 |
| Rellenar un formulario PDF | afxe | Impresión | 1 | 24-07-2006 18:37:03 |
| Rellenar formularios automaticamente | Osorio | Internet | 3 | 06-02-2004 22:39:06 |
|