I'm trying to compile the following code by Pat Thoyts on Windows via
critcl, and am getting an error. I have critcl, mingw, and all relevant
Tcl libs installed via teacup or my own installation, but the
compilation is not working.
critcl::cproc AddFontResource {Tcl_Interp* interp Tcl_Obj* pathObj} ok {
Tcl_DString ds;
Tcl_Encoding unicode;
int len, r = TCL_OK;
const char *path = Tcl_GetStringFromObj(pathObj, &len);
Tcl_DStringInit(&ds);
unicode = Tcl_GetEncoding(interp, "unicode");
Tcl_UtfToExternalDString(unicode, path, len, &ds);
if (AddFontResourceExW(Tcl_DStringValue(&ds), FR_PRIVATE, NULL)
== 0) {
r = TCL_ERROR;
}
Tcl_DStringFree(&ds);
Tcl_FreeEncoding(unicode);
return r;
}
"critcl -pkg fonticon.tcl" is the command.
critcl complains that "FR_PRIVATE" is undefined.
I am probably missing a header inclusion or linker flag, but I am a bit
out of my depth on Windows at the C level and am not sure how to fix.
Can anyone point me in the right direction?
--Kevin
--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com