0

Hey again. I'm working on and off on my little tool that currently installs fonts, writes the registry, and will do various other things i'm gonna need.

I'm currently trying to implement full error checking before i go on, and i'm pretty clueless on how to use return values. I know that it's a stupid question, but,

AddFontResource(myFont);

Return Values

If the function succeeds, the return value specifies the number of fonts added.
If the function fails, the return value is zero. No extended error information is available.

Okay, so how exactly do i get those return values to be able to use them for error checking? Do i simply put return after the function? I'm clueless on this one.

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by Th3_uN1Qu3
0
if (AddFontResource(myFont) == 0) {
    // Alas... YOU know what to do in that case...
}

As far as I know it's possible to define several filenames in the argument string ( | separated names). In that case you know how many font files needed so you can set more useful test:

if (AddFontResource(myFontList) != N) { // YOU know N value...

What's a problem?..

0

Thanks, it's just now that i noticed the function is declared as int and therefore can be used just like an integer... I still have a lot to learn you know. :)

Thanks for the help, it works.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.