Archive: DirText issue


DirText issue
When trying to override the default GUI text using the DirText variable, I keep getting the following error from MakeNSISW

DirText expects 0-3 parameters, got 4.
Usage: DirText [directory_page_description] [directory_page_subtext] [browse_button_text] [browse_dlg_text]

Ok, now to me that looks like 4 parameters going by the 'Usage' text, I'm supplying 4, so why does the function want 0 - 3?!

btw, im using the latest nightly cvs snapshot - downloaded about 10 mins ago.


Thanks, that's a little typo in tokens.cpp. I have fixed this on my local version, but I can't upload right now because it includes far more than just this fix. I hope to upload it this evening. If you have a compiler you can change tokens.cpp line 49 to:

{TOK_DIRTEXT,"DirText",0,4,"[directory_page_description] [directory_page_subtext] [browse_button_text] [browse_dlg_text]"},


And just one more thing while im in the 'fixing bugs' frame of mind...

BIF_RETURNONLYFSDIRS doesnt work as it should do on XP and 2003 - and possibly other OS's. The SHBrowseForFolder function needs to also rely on its callback procedure. You can test this by selecting 'My Computer'. It 'should' grey out the Ok button but it doesnt.

I would like to suggest you add the following to 'BrowseCallbackProc' in the file UI.c


else if(uMsg==BFFM_SELCHANGED)
{
TCHAR szDir[MAX_PATH];
if(!SHGetPathFromIDList((LPITEMIDLIST) lparam ,szDir))
{
// Disable the OK button if the currently selected item isnt a valid path
SendMessage(hwnd, BFFM_ENABLEOK, 0, false);
}
}


You might also need to '|' an addition flag 'BIF_VALIDATE' in the BROSWEINFO structure before you call the SHBrowseForFolder function.

Thanks, fixed that too.


Nice one :)

Now I just have to wait and see which nightly snapshot contains the fixes ;)


Uploaded.