LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get a web page's size property?

I'm using the Microsoft Internet Control library to control Internet Explorer. My problem is that I need to get the size properties of the web page that I downloaded to calculate the download speed. Does anyone know how to get the size information?

Thanks,
Mark
0 Kudos
Message 1 of 6
(3,668 Views)
Hello Mark,

You would use the IInetGetHeader function with the header being "Content-length". This will return the length in bytes of the data you are going to download.

The code might look something like:

char * fileSize;
BSTR * headerBSTR;
VARIANT headerName
CA_CStringToBSTR ("Content-length", headerBSTR);
netCtlsObjects_IInetGetHeader (objecthandle, NULL, CA_VariantBSTR (headerBSTR), fileSize);

Refer to the following webpage.

Thanks.
Wendy L
LabWindows/CVI Developer Newsletter
Message 2 of 6
(3,653 Views)
Hi Wendy,

Thanks for your help! Do you know what library the netCtlsObjects_IInetGetHeader function is in? I'm not having any luck finding it. I'm using CVI 7.1.1.

Thanks again,
Mark
0 Kudos
Message 3 of 6
(3,636 Views)
Hello MarkNSN,

The name of the function is actually InetCtlsObjects_IInetGetHeader. If you create an instrument driver for the Microsoft Internet Control (Tools >> Create ActiveX Controller), it will be included there.

Thanks.
Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 4 of 6
(3,633 Views)
Hi Wendy,

I'm sorry to sound like a rock, but I'm still not having any luck. I tried creating all types of the Internet Controls ActiveX controllers and I still can't find any functions that contain "GetHeader." I appreciate your help and patience.

Thanks,
Mark
0 Kudos
Message 5 of 6
(3,622 Views)
Hello Mark,

You might have an older version of Internet Explorer. I am currently running Internet Explorer 6, Win XP, and CVI 7.1.1. I have attached the .fp file so you can take a look at the list of functions I have once I create an Internet Controls ActiveX controller.

Hope this helps.
Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 6 of 6
(3,592 Views)