0

I am writing program in gdi+ c++.
How can I know two Font* p1, Font* p2 are the same.

p1 and p2 are points of different address.
p1 p2 point to different object:)

David Ansermot
  • 6,052
  • 8
  • 47
  • 82
user25749
  • 4,825
  • 14
  • 61
  • 83
  • Are you looking to see if both pointers address the same object or whether you have two instances of the same font (by family, size, weight, etc)? Can you explain what you are trying to achieve then we can more accurately address your question. Sample code of what you are currently trying and how it is failing for you would be a great addition to your question also. – Lazarus Jul 31 '09 at 09:34
  • This has also been posted at http://stackoverflow.com/questions/1211574, voted to close other question. – Dominic Rodger Jul 31 '09 at 09:35

1 Answers1

0

To compare if the pointers point to the same address / object see StackOverFlow Question How to compare pointers.

In order to check if the font are the equivalent (e.g. same font , size, and style), you want to compare the output of

of the two fonts.

Alternately you can call Font::GetLogFontA or Font::GetLogFontW and compare each of the structure entries you are interested in equating.

Community
  • 1
  • 1
Appleman1234
  • 15,946
  • 45
  • 67