[comp.windows.ms.programmer] Previous post on Font Resource saga ....

wolf@netcom.COM (Buckskin Tech.) (04/11/91)

drift@qut.edu.au (Glenn Wallace) writes:

>Ahem. I can get AddFontResource to work if I pass it the name of my
>library that has the fonts in. It returns 16.

>If I used the advertised feature of passing a handle to the library in the
>low word, high word=0 (using MAKEINTRESOURCE as shown in my previous post)
>it returns 0. <sigh>

>Has anyone used AddFontResource _WITHOUT_ specifying the name of the lib?

Maybe it's just me, but according to my Microsoft SDK TIPS.TXT file, it
warns against using handles with AddFontResource.  I quote:

* ----------------------------------
* 1.10  Font as a resource in an EXE
* ----------------------------------
*  
* Although not encouraged, fonts may be added to the resources
* of an application.  To access these fonts use the function
* AddFontResource.  Use the filename of the .EXE file as the
* parameter to this function.  This is in contrast to 2.x,
* where you could do a FindResource call using RT_FONTDIR,
* load the resource and then add the font resource using the
* handle returned from LoadResource.
 
 - Phil

drift@qut.edu.au (Glenn Wallace) (04/12/91)

wolf@netcom.COM (Buckskin Tech.) writes:
>>Has anyone used AddFontResource _WITHOUT_ specifying the name of the lib?
> 
> Maybe it's just me, but according to my Microsoft SDK TIPS.TXT file, it
> warns against using handles with AddFontResource.  I quote:

Hmm. (Shame on me not reading my TIPS.TXT!)

Their warning about not encourging fonts in exe files is (I think) saying
that you should put them in a .FON file (which is a null EXE file with only
font and fontdir resources ... see link problem).

Perhaps you have hit the nail on the head with what my problem is ... 
the handle they are talking about in the SDK doco (for the font lib) is
one returned from LoadResource and _NOT_ (as I assumed) LoadLibrary.

I'll try that (inconvenient as it is, seeing as I'm already loading the DLL)
and see wot happens.

Glenn.
drift@qut.edu.au

sig ommitted as it is "Be Nice to Modems" week.