Re: programs/winefontcfg: Add winefontcfg (try 3)

2007-07-13 Thread Dan Kegel

All in all the app looks like it's coming along nicely.
I apologize for catching so few problems in each pass,
but we'll get there.

Is there a way you can get the path to the currently running
instance instead of hardcoding it?
Then it would work even if winefontcfg isn't on the PATH.

+static const WCHAR cmdstr[] = {
+'w', 'i', 'n', 'e', 'f', 'o', 'n', 't', 'c', 'f', 'g', '.',
'e', 'x', 'e', '.', 's', 'o', ' ',

You're still using nonstandard C; you can't have
initializers on nonstatic arrays.  This is the third
time I have pointed this out; you should look
to make sure you don't do this anywhere in the program.
You should make sure the app can build with visual C 6 if you haven't
lately, too.
+static void TabSelChanged(HWND hTab)
+{
+int tab[NUMTAB][MAXOBJPERTAB] = {

Say, why is hwndTab static here?  I bet that's a cut and paste error:

+static HWND InitTab(HWND hdlg, HFONT hf)
+{
+static HWND hwndTab;

Looks like variable reuse abuse here; maybe you should
have a more mnemonic name for the return value of wcstolong:

+j = wcstolong(buf);

It might be nice to have comments identifying the big hunks
of the program, e.g. if all the code for one tab was grouped under
a comment with the name of the tab.
- Dan




Re: programs/winefontcfg: Add winefontcfg (try 3)

2007-07-13 Thread Dan Kegel

Nigel wrote:

Is there a way you can get the path to the currently running
instance instead of hardcoding it?
Then it would work even if winefontcfg isn't on the PATH.


+GetFullPathNameW(exename, MAXSTRLEN, szFullPathName, NULL);


That just prepends the current directory onto
the given filename, which is not what you want, I think.

I think you want something like GetModuleFileName(NULL,
szPathFullName, MAXSTRLEN).