|
chimera67 wrote: Or am I just asking questions without answers?
Oh I believe there's an answer alright I'm just not sure it's a "documented" answer. I reread your post and with your follow-up comments it makes more sense. Unfortunately, I don't have an answer for it. I'd find the object model for I.E. and start looking.
This looks interesting Microsoft[^] and in that link the "Associated Browser Reference" looks good. I'm sure you have seen both of these but that's about as far as I can go. I've got a super tight deadline for the morning.
- Rex
The enemy's gate is down.
Welcome to CP in your language. Post the unicode version in My CP Blog[^] now.
People who don't understand how awesome Firefox is have never used CPhog. The act of using CPhog alone doesn't make Firefox cool. It opens your eyes to the possibilities and then you start looking for other things like CPhog and your eyes are suddenly open to all sorts of useful things all through Firefox. - (Self Quote)
|
|
|
|
|
K, thanks. Perhaps Microsoft actually didn't create a documented method to figure out the favorite icon for a web page.
Seems strange that they didn't, but perhaps it is true and everything has to be done the hard way.
|
|
|
|
|
Well, I have at least made an effort. Been a very long time since I've done this. When I get a chance I'll check this thread and see if you have an answer. If you don't I'll email a few people I know at Microsoft and see if an answer (from the inside) can be obtained. Hopefully you don't have to wait that long...
Good Luck Though!
- Rex
The enemy's gate is down.
Welcome to CP in your language. Post the unicode version in My CP Blog[^] now.
People who don't understand how awesome Firefox is have never used CPhog. The act of using CPhog alone doesn't make Firefox cool. It opens your eyes to the possibilities and then you start looking for other things like CPhog and your eyes are suddenly open to all sorts of useful things all through Firefox. - (Self Quote)
|
|
|
|
|
I'm about as far from a web or web-related expert as it gets, but I'd bet you could get to the entirety of the HTML document (/head/link tags included, where the favicon tag will be) by using the DOM heirarchy provided by the IE COM interfaces.
Unless, of course, this process is what you were referring to as 'parsing the HTML'.
--
Russell Morris
Morbo: "WINDMILLS DO NOT WORK THAT WAY!"
|
|
|
|
|
Thanks! Yeah - I'm already parsing DOM.
Just figured that perhaps IE already had this information and is making it available via COM (like most everything else).
DOM is cool, but unless you do some fancy stuff it is pretty much "after the fact". If the bowels of IE already kept track of the favorites icon -- then duplicating that effort is kind of unecessary, complicated, and also slow.
|
|
|
|
|
IE6 only gets the favicon.ico when you create a Favourite. One of the common complaints is that IE loses Favourite icons over time, because they're stored in Temporary Internet Files and so either get replaced by newer content as the cache fills up, or get lost due to one of the many cache corruption bugs in IE6. You can get it to recover them by dragging the icon from the address bar and dropping it back on there.
It's probably possible to get the right icon from a favourite/URL Shortcut if you happen to have one, but it's probably not going to be very reliable.
IE7 Beta 2 always fetches the favicon but I don't know whether that's something that the WebBrowser control is doing, or whether it's the IE shell.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
|
Hi all,
I'm reading 8 bytes from a byte array in order to create a double value. In order to do this I must fist read the bytes into an int64 then cast this to double. I'm having a little trouble shifting the array values into the correct position within the __int64.
__int64 *buf = new __int64;
*buf = (((((((data[6] | data[7] << 8) | data[8] << 16 ) | data[9] << 24 ) | data[10] << 32 ) | data[11] << 40 ) | data[12] << 48 ) | data[13] << 56 );
__int64 foo = ((data[10] | data[11] << 8) | data[12] << 16 ) | data[13] << 24;
__int64 bar = (((data[10] << 32) | data[11] << 40) | data[12] << 48 ) | data[13] << 56;
*foo <<= 32;
double* dub = (double *)buf;
double val = *dub;
As you can see from my code I am unable to read all 8 bytes in one line. The bytes only fill the first 32 bits. So when the values are read into *buf, the first 4 bytes goto the correct position then the next 4 bytes overwrite them. Why is this? If I read the first 4, then shift them 32 bits, then read the next 4 I can correctly read them. But why can't I read them in 1 line of code?
|
|
|
|
|
waldermort wrote: data[10] << 32
This expression returns 0 because an int is 32 bits. You need to make the left hand side a 64-bit int so the compiler knows you want a 64-bit result:
(__int64)data[10] << 32
Also you should be using unsiged __int64 - always use unsigned types when doing bit shifting.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Thanks for the reply, I understand your answer though I cannot understand why the compiler thinks it to be a 32 bit int. In all 3 of my examples the data type was create as a 64 bit int, int is never mentioned. So why should I have to cast the byte?
|
|
|
|
|
waldermort wrote: So why should I have to cast the byte?
Because a byte left-shifed by anything more than 8 bits is zero. Just as a short shifted by anything more than 16 bits is zero.
The compiler only looks at one expression at a time, it doesn't know that it's ultimately going to assign to a 64-bit int. The promotion to __int64 doesn't happen until the entire right-hand side is evaluated, but by that time data has been lost.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Aaah, Gotcha. Thanks for the info.
|
|
|
|
|
Is there a reason you want it in one line?
A small loop can handle it with a lot more clarity and maintainability.
|
|
|
|
|
Hello all,
I have implemented an http server in which whenever the client requests a file, my server sends the file. My client is Windows Media Player and I generate the request from the "Open URL" option.
Now I want to implement that whenever client requests a file, the sever should send the same file continuously in a loop, and the client should play that file in a loop.
Can anybody help?
Regards,
Harshita
|
|
|
|
|
I have a project which when compiled by VC++ 2003 Pro produce a DLL of 145KB. When I compile this project in VC++ 2005 Std the DLL is 158KB.
Does this mean VC++ 2003 produces better code ?
BTW, the project in question is a Monkey's Audio input plugin for the QCD audio player (http://quinnware.com/bin/plugins/input/sup_QCDApeSrc.zip)
|
|
|
|
|
I have seen the same thing with regard to the size of the code produced, but unless you make the distinction that smaller code = better code, then you cannot say that the small stuff is better. There is probably more error handling and checks in the 2005 version as well as default settings could be different.
Steve Maier, MCSD MCAD
|
|
|
|
|
I have a class called Point. I am creating a class called Point3D that is inherited from Point. Point has private data members int xCoord, yCoord. Point also has functions called getX() and getY().
Point3D is inheriting from Point. Point 3D has a new datamember int zCoord. Point also has a function distanceFrom that looks like this:
double Point::distanceFrom(Point& p) { //distance between this point & p
return sqrt((xCoord - p.xCoord) * (xCoord - p.xCoord) +
(yCoord - p.yCoord) * (yCoord - p.yCoord));
}
Point's header file looks like this:
class Point{
public:
Point(); //default constructor
Point(double, double, string); //conversion constructor
double getX() const;
double getY() const;
string getName() const;
void setX(double);
void setY(double);
void setName(string);
double distanceFrom(Point&);
void printP();
private:
double xCoord, yCoord; //coordinates of the point
string name; //name of the point
};
so I am trying to overload the distanceFrom function to use the zCoord. Here is what I have:
double Point3D::distanceFrom(Point3D& p3D)
{
return sqrt((p3D.getX() - getX()) * (p3D.getX - getX()) +
(p3D.getY() - getY()) * (p3D.getY() - getY()) +
(p3D.zCoord - getZ()) * (p3D.zCoord - getZ()));
}
but i am getting these errors:
error C2475: 'Point::getX' : forming a pointer-to-member requires explicit use of the address-of operator ('&') and a qualified name
error C2475: 'Point::getX' : forming a pointer-to-member requires explicit use of the address-of operator ('&') and a qualified name
error C2296: '-' : illegal, left operand has type 'double (__thiscall Point::* )(void) const'
can anyone shed some light why i cannot do this? I just want to inherit the functions from Point (getX getY) to get x and y values. then get my z coordiate to get the distance.
Thank you,
Ed
|
|
|
|
|
Ed, does this work?
return sqrt((p3D.getX() - <code>this.</code>getX()) * (p3D.getX - <code>this.</code>getX()) + etc... /ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Thank you for the quick response, however, i get this...
error C2228: left of '.getX' must have class/struct/union type
error C2228: left of '.getX' must have class/struct/union type
???
|
|
|
|
|
Argh - I'm blind. The code has a typo. The compiler error is referring to getX when you probably I meant getX() .
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
-- modified at 15:50 Tuesday 25th April, 2006
|
|
|
|
|
Thanks again for the quick response ravi.
I made the changes to :
double Point3D::distanceFrom(Point3D& p3D)
{
return sqrt((p3D.getX() - this.getX()) * (p3D.getX() - this.getX()) +
(p3D.getY() - getY()) * (p3D.getY() - getY()) +
(p3D.zCoord - getZ()) * (p3D.zCoord - getZ()));
}
I am still getting that error.
Funny, when i comment the first line out
double Point3D::distanceFrom(Point3D& p3D)
{
return sqrt(//(p3D.getX() - this.getX()) * (p3D.getX() - this.getX()) +
(p3D.getY() - getY()) * (p3D.getY() - getY()) +
(p3D.zCoord - getZ()) * (p3D.zCoord - getZ()));
}
it's a okay!
here are my declarations from my point class...
double Point::getX() const {
return xCoord;
}
double Point::getY() const {
return yCoord;
}
|
|
|
|
|
nevermind, i got it. thanks Ravi!
|
|
|
|
|
etm124 wrote: return sqrt((p3D.getX() - getX()) * (p3D.getX - getX()) +
The third getX is missing the parentheses to make it a function call.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
If have MFC MDI application how can I use all new Office 12 styles in my application.
Do you know is any SDK available to get this styles from Office 12
If yes is it unmanaged and is it support Windows XP?
I saw a lot of third party components which looks similar to Blue Ribbon but nothing from the MIcrosoft.
Thanks for any info.
|
|
|
|
|
CodeJock has them.
http://www.codejock.com/[^]
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|