How to use IHTMLFramesCollection2 to get elements in each frame?

In a project, I must visit elements value from HTML page, read or write. but there is a message 'error -2147467262 occurred at property node (arg1) in DocumentObjectMode.vi'. take the attached file for example, when I read the length of IHTMLFramesCollection2, the error shows. How it could be?
David Xia
Attachments:
FrameTest.zip ‏15 KB
error 2147467262.JPG ‏15 KB

Try running your code in the User Interface execution subsystem (VI Properties - Execution).  That eliminates the error for me (Win XP, LabVIEW 2011).
I'm not certain this is uniquely LabVIEW behavior.  Try running a Google search for "ihtmldocument2 frames property invalidcastexception" and you'll see that people using other languages appear to be having the same problem.  Several of the threads in those results say they were able to solve it by forcing everything to run in one thread, which is essentially what you're doing by changing to the user interface execution system.
One style note: you should close ALL ActiveX references that you open (the WebBrowser, Document, and IHTMLFramesCollection objects), in the opposite order in which you open them.  Also, I find it cleaner to use constants instead of controls for the ActiveX types (such as the type input to Variant to Data).

Similar Messages

  • How to use adobe email in elements

    how to use adobe email in elements 11

    I am referring to the email option of having the photos embedded in the text and not as an attachment.  It is called Photo Mail in Organizer where you add the photos, then choose stationery & border layouts, etc.  I don't have have access to Outlook or any other type of email account.
    The only way for me to send photos direct from Photoshop Elements is by using Adobe email service. I had no problems in earlier versions, but this option does not work in Version 11. When I tried to use the email in version 9 (after I loaded version 11), I kept getting error messages that it was no longer available or supported.
    This option is found in Organizer, Preferences,Shating, Adobe E-mail service (from the email menu).
    Thanks

  • How to use the FormDownload UI element?

    Hi, 
       I am a newbie in ABAP Webdynpro and I want to know how to use the FormDownload UI Element. Any hints plz? Thanks in advance.

    Hi,
              I used CONVERT_OTF FM to convert the otf data to pdf data.  In my form user has the option to view the smartform (a button) or to directly download the pdf from smartform output without displaying the output. While the former has been taken care of by using InteractiveForm UI element and is displaying the smartform output fine, I am not being able to implement the second option. I have given a supply function to the pdfsource context node but am clueless about what to write to pass pdf data. In the sam WD component WDR_TEST_EVENTS, the FileDownload is used to save a text file with just one line. But how can I save a pdf file? I have assigned mime to application/pdf. How will I proceed now? Please suggest. Thanks in advance.

  • How to use data of multiline element from workflow container

    Hi,
    Can you please tell me how to access rows of multiline element of workflow container.
    Scenario is like below.
    I have values in a multiline container(table) of workflow container.
    Now inside Fork branches  i need to check for specific data in the above table and with that condition i have to send workitem.
    I hope u can understand,otherwise please revert.
    Thanks in advance,
    Madhu

    You cannot didrectly check the condition...
    what you have to do is.. write a inside the method as below and set the flag...and use the flag in condition editor...
    SWC_GET_TABLE CONTAINER 'AGENTS'  lt_agents.
    loop at lt_agents ino wa_agents.
    if wa_agents = 'A'.
    lv_flag = X.
    endif.
    endloop.
    SWC_SET_ELEMENT CONTAINER 'FLAG' lv_flag.
    Create an export parameter FLAG as char1 with export marked.
    Do the neccesary bindings from task to workflow.
    Then in workflow check this flag in condition editor.

  • How to use reflection to get base classes protected field

    I have one base Base classes which have protected fields and public get method to get the field.
    class Base
    protected int proField;
    public int getProField(){return proField;}
    Class Derive extends base class Base
    class Derive extends Base implements OtherInterface
    public void funtion(){};
    Now I have an instance of Derive, how can I use reflection to get the protected field inherited from Base. It seems Java Reflection only give runtime accessibility to public field and decleared field, protected-inherited field is excluded.
    Thanks
    Lei

    as the last poster said, traverse up the class hierarchy.
    ex:
    private void doSumfinToField(String fieldName throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException {
    Class clazz = getClass();
    Field field = findFieldInClass(clazz, fieldName);
    //field.doSumfin;
    private Field findFieldInClass(Class clazz, String fieldName) throws NoSuchFieldException {
    try { // to find the field in this class    
    return clazz.getDeclaredField(fieldName);
    } catch (NoSuchFieldException e) {
    // if we don't have a superclass, continue
    if (clazz.getSuperclass().equals(Object.class)) {
    throw e;
    // check in the superclass
    return findFieldInClass(clazz.getSuperclass(), fieldName);
    }

  • How to use PDPageEnumContents to get PDText?

    Please help me to use PDPageEnumContents to get PDText, the callback and PDGraphic confused me. I donnot know how to write. I am a green hand in Plugin Development.
    Thank you.
    Jason Wang

    This is an obsolete method. It should no longer be used.
    Aandi Inston

  • How to use "setVariableData" with a "Element" typed variable ?

    Can anyone give me a simple exemple to :
    - read a field in a XML element variable (not a "message type" variable)
    - update the value of a field in a XML element variable (not a "message type" variable)
    in Java activities.
    ("getVariableData" and "setVariableData")
    The only documentation I found is for "message type" variables...
    Thank you in advance !

    Get :
    Element elem = (Element)getVariableData("varElementType","/ns1:Donnee/ns1:champ1");
    String value = elem.getFirstChild().getNodeValue());
    Set :
    setVariableData("varElemType", "/ns1:Donnee/ns1:champ1", "this is a new value", false);
    If anyone has a better solution, he is welcome :)

  • How to use the frameaccess code to convert video frames to jpeg files

    Hello everyone. I am working on a project on video processing, and i need to be able to do image processing on individual video frames. However, to do this, I need to convert the frames to an appropriate format, namely jpeg. It is actually the conversion from buffer frame to BufferedImage that is important, as i already have an approximate knowledge of filewriter for the saving of already rendered file.
    The original frameaccess code can be found here: http://java.sun.com/products/java-media/jmf/2.1.1/solutions/FrameAccess.html
    there are several other threads tied to this topic, some of which do not work for me, or simply do not suit my needs, so please do not link me to them unless you are sure its the real solution.
    if any one could help me by showing me the way of doing it correctly, and maybe give a nice short explanation, i would be very grateful.
    Thanks you.
    P.s: i am only a beginner to intermediate student in java and programming in general so...

    Here is the code i am currently using.
    package Test;
    import java.io.*;
    import java.util.*;
    import java.awt.*;
    import javax.media.*;
    import javax.media.control.TrackControl;
    import javax.media.Format;
    import javax.media.format.*;
    import javax.media.bean.playerbean.MediaPlayer;
    import javax.media.util.*;
    import java.awt.image.BufferedImage;
    import java.awt.image.RenderedImage;
    import java.awt.image.*;
    import javax.imageio.ImageWriter;
    import javax.imageio.ImageIO;
    import javax.media.control.FrameGrabbingControl;
    * Sample program to access individual video frames by using a
    * "pass-thru" codec. The codec is inserted into the data flow
    * path. As data pass through this codec, a callback is invoked
    * for each frame of video data.
    public class FrameAccess extends Frame implements ControllerListener {
    Processor p;
    Object waitSync = new Object();
    boolean stateTransitionOK = true;
    * Given a media locator, create a processor and use that processor
    * as a player to playback the media.
    * During the processor's Configured state, two "pass-thru" codecs,
    * PreAccessCodec and PostAccessCodec, are set on the video track.
    * These codecs are used to get access to individual video frames
    * of the media.
    * Much of the code is just standard code to present media in JMF.
    public boolean open(MediaLocator ml) {
         try {
         p = Manager.createProcessor(ml);
         } catch (Exception e) {
         System.err.println("Failed to create a processor from the given url: " + e);
         return false;
         p.addControllerListener(this);
         // Put the Processor into configured state.
         p.configure();
         if (!waitForState(p.Configured)) {
         System.err.println("Failed to configure the processor.");
         return false;
         // So I can use it as a player.
         p.setContentDescriptor(null);
         // Obtain the track controls.
         TrackControl tc[] = p.getTrackControls();
         if (tc == null) {
         System.err.println("Failed to obtain track controls from the processor.");
         return false;
         // Search for the track control for the video track.
         TrackControl videoTrack = null;
         for (int i = 0; i < tc.length; i++) {
         if (tc.getFormat() instanceof VideoFormat) {
              videoTrack = tc[i];
              break;
         if (videoTrack == null) {
         System.err.println("The input media does not contain a video track.");
         return false;
         System.err.println("Video format: " + videoTrack.getFormat());
         // Instantiate and set the frame access codec to the data flow path.
         try {
         Codec codec[] = { new PreAccessCodec(),
                        new PostAccessCodec()};
         videoTrack.setCodecChain(codec);
         } catch (UnsupportedPlugInException e) {
         System.err.println("The process does not support effects.");
         // Realize the processor.
         p.prefetch();
         if (!waitForState(p.Prefetched)) {
         System.err.println("Failed to realize the processor.");
         return false;
         // Display the visual & control component if there's one.
         setLayout(new BorderLayout());
         Component cc;
         Component vc;
         if ((vc = p.getVisualComponent()) != null) {
         add("Center", vc);
         if ((cc = p.getControlPanelComponent()) != null) {
         add("South", cc);
         // Start the processor.
         p.start();
         setVisible(true);
         return true;
    public void addNotify() {
         super.addNotify();
         pack();
    * Block until the processor has transitioned to the given state.
    * Return false if the transition failed.
    boolean waitForState(int state) {
         synchronized (waitSync) {
         try {
              while (p.getState() != state && stateTransitionOK)
              waitSync.wait();
         } catch (Exception e) {}
         return stateTransitionOK;
    * Controller Listener.
    public void controllerUpdate(ControllerEvent evt) {
         if (evt instanceof ConfigureCompleteEvent ||
         evt instanceof RealizeCompleteEvent ||
         evt instanceof PrefetchCompleteEvent) {
         synchronized (waitSync) {
              stateTransitionOK = true;
              waitSync.notifyAll();
         } else if (evt instanceof ResourceUnavailableEvent) {
         synchronized (waitSync) {
              stateTransitionOK = false;
              waitSync.notifyAll();
         } else if (evt instanceof EndOfMediaEvent) {
         p.close();
         System.exit(0);
    * Main program
    public static void main(String [] args) throws IOException {
         /*if (args.length == 0) {
         prUsage();
         System.exit(0);
         //String url = args[0];
         String url = new String ("file:D:FiMs/avpr.avi");
         if (url.indexOf(":") < 0) {
         prUsage();
         System.exit(0);
         MediaLocator ml;
         //MediaPlayer mp1 = new javax.media.bean.playerbean.MediaPlayer();
         //mp1.setMediaLocation(new java.lang.String("file:D:/FiMs/299_01_hi.mpg"));
         //mp1.start();
         if ((ml = new MediaLocator(url)) == null) {
         System.err.println("Cannot build media locator from: " + url);
         System.exit(0);
         FrameAccess fa = new FrameAccess();
         if (!fa.open(ml))
         System.exit(0);
    static void prUsage() {
         System.err.println("Usage: java FrameAccess <url>");
    * Inner class.
    * A pass-through codec to access to individual frames.
    public class PreAccessCodec implements Codec {
    * Callback to access individual video frames.
         void accessFrame(Buffer frame) {
         // For demo, we'll just print out the frame #, time &
         // data length.
         long t = (long)(frame.getTimeStamp()/10000000f);
         System.err.println("Pre: frame #: " + frame.getSequenceNumber() +
                   ", time: " + ((float)t)/100f +
                   ", len: " + frame.getLength());
         * The code for a pass through codec.
         // We'll advertize as supporting all video formats.
         protected Format supportedIns[] = new Format [] {
         new VideoFormat(null)
         // We'll advertize as supporting all video formats.
         protected Format supportedOuts[] = new Format [] {
         new VideoFormat(null)
         Format input = null, output = null;
         public String getName() {
         return "Pre-Access Codec";
         // No op.
    public void open() {
         // No op.
         public void close() {
         // No op.
         public void reset() {
         public Format [] getSupportedInputFormats() {
         return supportedIns;
         public Format [] getSupportedOutputFormats(Format in) {
         if (in == null)
              return supportedOuts;
         else {
              // If an input format is given, we use that input format
              // as the output since we are not modifying the bit stream
              // at all.
              Format outs[] = new Format[1];
              outs[0] = in;
              return outs;
         public Format setInputFormat(Format format) {
         input = format;
         return input;
         public Format setOutputFormat(Format format) {
         output = format;
         return output;
         public int process(Buffer in, Buffer out) {
         // This is the "Callback" to access individual frames.
         accessFrame(in);
         // Swap the data between the input & output.
         Object data = in.getData();
         in.setData(out.getData());
         out.setData(data);
         // Copy the input attributes to the output
         out.setFormat(in.getFormat());
         out.setLength(in.getLength());
         out.setOffset(in.getOffset());
         return BUFFER_PROCESSED_OK;
         public Object[] getControls() {
         return new Object[0];
         public Object getControl(String type) {
         return null;
    public class PostAccessCodec extends PreAccessCodec {
         // We'll advertize as supporting all video formats.
         public PostAccessCodec() {
         supportedIns = new Format [] {
              new RGBFormat()
    * Callback to access individual video frames.
         void accessFrame(Buffer frame) {
         // For demo, we'll just print out the frame #, time &
         // data length.
         long t = (long)(frame.getTimeStamp()/10000000f);
         System.err.println("Post: frame #: " + frame.getSequenceNumber() +
                   ", time: " + ((float)t)/100f +
                   ", len: " + frame.getLength());
         public String getName() {
         return "Post-Access Codec";
    and here is what itprabhu5 proposed to use to convert and save the frames as .png(or .jpeg in the same way)
    import java.io.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.image.*;
    import javax.imageio.*;
    import javax.media.*;
    import javax.media.control.*;
    import javax.media.format.*;
    import javax.media.util.*;
    * Grabs a frame from a Webcam, overlays the current date and time, and saves the frame as a PNG to c:\webcam.png
    * @author David
    * @version 1.0, 16/01/2004
    public class FrameGrab
         public static void main(String[] args) throws Exception
              // Create capture device
              CaptureDeviceInfo deviceInfo = CaptureDeviceManager.getDevice("vfw:Microsoft WDM Image Capture (Win32):0");
              Player player = Manager.createRealizedPlayer(deviceInfo.getLocator());
              player.start();
              // Wait a few seconds for camera to initialise (otherwise img==null)
              Thread.sleep(2500);
              // Grab a frame from the capture device
              FrameGrabbingControl frameGrabber = (FrameGrabbingControl)player.getControl("javax.media.control.FrameGrabbingControl");
              Buffer buf = frameGrabber.grabFrame();
              // Convert frame to an buffered image so it can be processed and saved
              Image img = (new BufferToImage((VideoFormat)buf.getFormat()).createImage(buf));
              BufferedImage buffImg = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_RGB);
              Graphics2D g = buffImg.createGraphics();          
              g.drawImage(img, null, null);
              // Overlay curent time on image
              g.setColor(Color.RED);
              g.setFont(new Font("Verdana", Font.BOLD, 16));
              g.drawString((new Date()).toString(), 10, 25);
              // Save image to disk as PNG
              ImageIO.write(buffImg, "png", new File("c:\\webcam.png"));
              // Stop using webcam
              player.close();
              player.deallocate();
              System.exit(0);                    
    however, i am unable to use it together with my code... i m not even sure if im using it at the right place.. (note that u will have to discard some lines from the second code, because it is actually grabbing frames from a webcam in that example)
    if any1 can make it happen please help me. thx.

  • How to use LightRoom with Premier Elements?

    I have recently learned LightRoom 5 and feel fairly comfortable with it. I'm now in the process of working on movie editing starting with Premier Elements 11. I'm just starting to go through it and I see that it integrates with an organizer that seems germaine to the Elements group. Issue is that I'm already using LR for organization. Am consequently a bit confused.
    Can anyone suggest how to work with LR and Premier Elements together?
    A secondary question has to do with audio file management. I see that the Elements Organizer also includes audio files. But LR doesn't. To date I've managed audio with Windows Media Player. Can anyone offer any suggestions for moving forward with audio management?

    I use Lightroom 5.2 and Premier Elements 11 on a fast video optimized i7 PC laptop with lots of memory.  It even has a Blu-Ray burner!
    My photo and video files are first copied and stored by camera and date.  Then I use LR to organize and preview, review and select both photos and clips.  IMO, the clip preview ability of LR is very good.  LR will let you make some simple edits to clips but I don't use that for video, only photos.  My photos will be a mix of JPG and RAW and I will tune them with LR.  Some of the photos may get some extra masking or HDR work elsewhere and then brought back into LR.  
    As I've preview the clips, as well as photos, that I want to use I put them in a LR collection.  Next I prepare a project specific folder on my SSD named something like "Vacation Trip".   If it is a big project, I may make some sub folders such as city names.  
    The big step is to "Export" copies of all the assets I've selected for the collection.  I open the collection and select everything in it.  Right click, pick Export, set the destination, rename them if desired, select "include video", select "Original" video format, select PSD for images and push the Export button.
    The reason for "Original" video is because I don't want any extra compression or processing of the video clips.  I want Premier Elements to do that.  The reason for "PSD" is that I want my LR adjustments of the still photos to be included before I put them in the project. 
    Next I open a new PrE project.  Before adding any assets, I make sure the the scratch disks are assigned to the project folder. 
    With the scratch disks set, I then load the assets.  I make sure one of the primary video clips is the first to be placed on the timeline as that adjusts the "Project Settings" if necessary.  Then I start building the video with the security of knowing I'm only working on a set of image and clip copies.
    My audio file management is done entirely the old fashioned way in Windows Explorer.  I have an audio assets folder and a system of descriptive folder and file names.  I can preview them from Windows Explorer before I import a copy to a project folder.  Adjustments to volume and clip length are done to he copy in PrE.  I frequently buy a $2 audio clip from Vimeo specific for the project because I like having a license to use the music!
    When I'm done, I move the entire project folder somewhere for long term storage. 
    Hope some of this works for you.  If you have suggestions, I would appreciate hearing them.
    Bill

  • How to use the Transport Delay element?

    Hello everybody,
    I'm experimenting in Multism and I have to say that I am not an expert when it comes to eletronics. Unfortunately it's part of a project that I am involved in and I have to get to the bottom of it.
    In my circuit I want to use a relay or voltage controled switch to simulate the distruction of a cable. To add the element of time I need this to happen at different times. Googeling this topic I found out about an element called "Transport Delay". So far so good.
    Attached you will find my circuit. After using the switch J2 (A) i want the lamp to turn on and off about a second later. How do I change the delay time of this element? 
    If you have other smart solutions please do not hesitate to tell me, I would be very grateful.
    Yours Luke
    Attachments:
    Transport Delay.ms13 ‏119 KB

    Hello Ebra
    right click on the component select properties and then modify the model parameters.
    Hope it helps
    best regards
    Alexander Glasner
    AE NIE

  • How to use sdk to get the image in the pdf file created by illustrator?

    I have some pdf files create by illustrator and saved as pdf documents,
    now I want to use the sdk to get the image in pdf files.
    how to?
    Thanks.

    Thank you first!
    Yes,you are right,since I am new to illustrator,and I want to try to write a plugin,
    I have read the sdk doc and API and opened the sample in vs2010,but no idea about how to operate the pdf doc in illustrator with api.
    Hope more advise or any examples,thank a lot.

  • I'm new to iPad and have downloaded the Nook app but don't know how to use it to get Nook books to download from my account at BN.

    I am new to iPad and have downloaded the Nook app.  How do I use it to read the Nook books are that in my account from Barnes&Noble?

    From http://www.barnesandnoble.com/ebooks/help-faqs.asp#NOOKapp
    How do I download my books to my device? I get a message "Safari cannot Download".Launch the NOOK app software to trigger the automatic syncing of your purchases to your device. You can also manually tap the 'gear' button in the lower right-hand corner of the navigation bar and then hit Account Settings. This will open a screen to allow you to enter your login information which includes your account name and password. Press Go and your information will be verified and then the contents of your on-line NOOK Library will be listed for you. Then just browse your book listings and tap on the book you'd like to download to your device. A popup will confirm your request. Press OK and the book will download to your device in the background, and you'll be notified when it has finished downloading.

  • How to use script to get the first table row on each page?

    I create a print form to display a table. I set a conditional page break on this table, so the table rows on each page could be different.
    For example, there're total 50 rows in this table. On the 1st page, there're 5 rows, but on the 2nd page, there're only 2 rows, and so on...
    Now I want to get some value from the 1st table row on each page. How can do that? I can refer to a table row using TableRow[n], but I don't know how to calculate 'n' in script (either FormCalc or JavaScript) for the 1st row on each page.
    Any ideas?

    Hi Wei,
    There is an option of setting the overflow header in the pallette. You may check that out. It is basically used to have the table header to be seen in all pages, if the table is overflowing to multiple pages. You may put your first row as the overflow header.
    - hope this helps, Kindly update,
    thanks and regards,
    - anto.

  • JNI: How to use FindClass to get a class in a Jar file?

    Is it possible to use the FindClass method of the JNI environment object to get a class that is in a jar file? My sample application was working when my class files were in the local directory. Now that I have replaced the class files with a jar file containing the classes, the app no longer works. I'd appreciate tips from anyone who knows how to do this.
    -Andreas

    Is it possible to use the FindClass method of the
    JNI environment object to get a class that is in a
    jar file? My sample application was working when my
    class files were in the local directory. Now that I
    have replaced the class files with a jar file
    containing the classes, the app no longer works. I'd
    appreciate tips from anyone who knows how to do this.It has nothing to do with JNI.
    The method uses the class path just like any other class loading situation in java. The reason it worked before is because your class path included the directory. It doesn't work now because either the jar is not in the class path or there is something wrong with the class path.

  • How to use loop in premiere elements 8?

    Hi,
    Using pre elements 8 and I don`t know how to set or use loop option in premiere elements 8
    Please help
    Vinay

    For an authored DVD, there is no capability to Loop that DVD, created in PrE. There are other authoring programs, like Sony's DVD Architect, and Adobe Encore (available only with PrPro), that allow this to be done easily.
    The way to do similar in PrE is to do an AutoPlay DVD and then this use the Repeat button on the DVD player.
    Good luck,
    Hunt

Maybe you are looking for

  • How can I move my /library folder to another drive?

    I'll try and keep this as brief as possible. (tl;dr version: My library folder is on the wrong drive. How can I move it?) About 18 months ago I switched the HDD in my mid 2009 MBP for an SSD and replaced the optical drive with a larger HDD for storag

  • Initial thoughts on Jdev 10.1.3 3673 build

    Much better guys... Lets be honest 10.1.12 was only going to convince someone who has been locked in a room on a very remote island, and been exposed to nothing but Oracle technologies, that Oracle was serious... but I actually quite like this... A l

  • PDF created from AutoCAD Electrical is not searchable due to "Simplex font", how to make it searchable

    We have a set of electrical drawings created by AutoCAD Electrical using "Simplex" font. They have no problem being displayed properly but the texts are not selectable or searchable. I've tested to re-draw part of the drawings in more common font suc

  • HT1386 how do you sync ringtones

    Hhow do you sync ringtones when they do not show up on Itunes?

  • Random successive crashes in AE CS6

    Hello Adobe Community! After effects CS6 crashes randomly about every 3 minutes or so. It just quits without any warning cough, or lag time. I only get this pop-up window when it's already too late. The crash doesn't seem to be triggered by any speci