12-13-2005 07:35 AM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
<!-- saved from url=(0041)http://169.254.3.1/main_frame_nologin.htm -->
<HTML><HEAD><TITLE>3Com - OfficeConnect 11Mbps Wireless Access Point</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.2800.1491" name=GENERATOR></HEAD><FRAMESET border=0
frameSpacing=0 frameBorder=0 cols=150,*><FRAME name=menu_screen marginWidth=0
marginHeight=0
src="3Com - OfficeConnect 11Mbps Wireless Access Point_files/menu_nologin.htm"
frameBorder=0 noResize scrolling=no><FRAMESET border=0 rows=*,30
frameBorder=0><FRAME name=main_screen marginWidth=0 marginHeight=0
src="3Com - OfficeConnect 11Mbps Wireless Access Point_files/login.htm"
frameBorder=0 noResize><FRAME name=statusLine marginWidth=0 marginHeight=0
src="3Com - OfficeConnect 11Mbps Wireless Access Point_files/stbar_waiting.htm"
frameBorder=0 scrolling=no></FRAMESET></FRAMESET></HTML>
Regards
Vevek
12-14-2005 05:49 PM
12-14-2005 08:08 PM
12-15-2005 07:52 AM
Andy,
i ahve tried out a looooooooooot...with the frames..not able to get the exact implmentation...
i ahve attached the vi but it shows error..as given by ravis
if you coudl share an example vi ..it would be very useful
12-15-2005 08:50 AM
Hi Ravis,
i aslo tried using IHTMLdocument2.frames...i get the refrence from IWebbrowser.document..
i guess that the reference is wrong...but i am not knowing how to use the IHTMLdocument2.frames..
the squence is as follows:
1. go to web browser
2. get the document in web browser
3. get the frame
4. collect the frame elements
5. go to a particular frame
6. read the frame and if any form is there login to the form and press submit!!
i have got a pseudo code in c# .i tried the same in labview and i am getting errors ..lots 😞
please help me with an eg vi if possible in labview!!!
using System;
namespace ConsoleApplication7
{
/// <summary>
/// Summary description for Class1.
/// </summary>
using System;
using mshtml;
using SHDocVw;
using System.Collections;
using System.Threading;
namespace ConsoleApplication1
{
class Class1
{
static InternetExplorer ie = null;
[STAThread]
static void Main(string[] args)
{
Class1 class1 = new Class1();
class1.Test();
Console.Read();
}
AutoResetEvent firstDocumentCompleted;
AutoResetEvent lastDocumentCompleted;
int completedDocuments;
int expectedDocuments;
public void Test()
{
Console.WriteLine("Starting:" + Thread.CurrentThread.ApartmentState.ToString());
ie = new SHDocVw.InternetExplorer();
ie.DocumentComplete += new DWebBrowserEvents2_DocumentCompleteEventHandler(DocumentComplete);
ie.Visible = true;
firstDocumentCompleted = new AutoResetEvent(false);
lastDocumentCompleted = new AutoResetEvent(false);
completedDocuments = 0;
expectedDocuments = 4;
object o = null;
ie.Navigate("http://www.htmq.com/html/sample/frame.htm", ref o, ref o, ref o, ref o);
firstDocumentCompleted.WaitOne(30000, false);
IHTMLDocument2 document = (IHTMLDocument2)ie.Document;
lastDocumentCompleted.WaitOne(30000, false);
IHTMLFramesCollection2 frames = (IHTMLFramesCollection2)document.frames;
for (int index = 0; index < frames.length; index++)
{
object i = index;
frames.item(ref i);
IHTMLWindow2 window = (IHTMLWindow2)frames.item(ref i);
IHTMLDocument2 frameDocument = (IHTMLDocument2)window.document;
Console.WriteLine(frameDocument.body.innerHTML);
}
Console.WriteLine();
}
public void DocumentComplete(object pDisp, ref object URL)
{
Console.WriteLine("DocumentComplete:" + Thread.CurrentThread.ApartmentState.ToString());
if (completedDocuments == 0)
{
firstDocumentCompleted.Set();
}
Interlocked.Increment(ref completedDocuments);
if (completedDocuments == expectedDocuments)
{
lastDocumentCompleted.Set();
}
}
}
}
}
12-15-2005 09:00 AM
Hi Andy/Ravis
Attached is a eg vi for the reading a frame. But i get error..
12-19-2005 06:24 PM
12-20-2005 08:16 AM
Hi Andy,
Your solution was great!!
But will it be possible to use the reference of the the activeX reference with the window's handler??
i mean is it possible to log to a site(eg yahoo....) through the key strokes ...and get into the page in back ground??without the active window?
i tried with the user32.dll and got to know that a "windows handler" reference should be passed..but how to pass from the IHTMLWebbrowser functions???
is there any other way of doing it in background??
i have attached the vi's for selecting the tab and writing a value to an application...
(note:i am not possible to integrate with the activeX eg(google eg) which you shared to us)
Please reply me ...
regards
vevek
12-21-2005 10:29 AM
Hi Andy,
I tried your approach of using key strokes (tabs) to login to a website..but i was not able to do the process in the back groud using the user32.dll interface with labview..(SINCE IT DOES FOR ONLY ACTIVE WINDOW!!)
i tried tried ...and tried...
is there any other way of doing the same task(login to a website or search google) by using key strokes..but should be done in back ground..?? or is it possible by using activex??
You stated in your mail that you were able to use the application of accessing a frame in CVI enviroment?? is that the c# code that i shared to you??
Is it possible to go to a particular frame and go to a form in that frame and login/search something in CVI??
i haven't worked in CVI enviornment.,...Could you suggest me a better approach with a example either in Labview or LabviewCVI so that it may be useful for me...(and also for many others!!!)
regards
vevek
12-21-2005 05:21 PM