How to get SetFocus events with Radio Buttons in MFC

Working in MFC today I wanted to know when the user clicked on a radio button so I could change the default button with SetDefID(IDC_LOAD_MEMORY_BTN) but for some reason after adding the event handler for BN_SETFOCUS I never got a notification.  After poking around the radio button’s properties in Visual Studio 2008 I found Notify – changing it from False to True allowed me to start receiving focus events

Preventing Renamed App From Creating New Registry Entry

In Visual Studio 2008, I was using MFC’s registry calls to save my program preferences.  The problem was new builds weren’t using the prior build’s settings. I was adding the build number to the .exe filename and this caused a new key to be created in the registry based on the .exe name and a new set of settings saved therein.  Inspecting CWinApp‘s m_pszAppName and m_pszExeName I saw both were PuffinApp914.  It turns out m_pszAppName is set to the string resource ID AFX_IDS_APP_TITLE if it’s there.  If AFX_IDS_APP_TITLE doesn’t exist then m_pszAppName is set to the .exe filename.  After adding AFX_IDS_APP_TITLE to the project’s string resources m_pszAppName became Puffin and m_pszExeName stayed with PuffinApp914.  The registry calls use m_pszAppName for the key so my problem was solved.

File Browser’s Samba Share Doesn’t Appear at Command Line

I used the File Browser application in Fedora 8 to mount a SMB volume (File -> Connect to Server… -> Windows Share (This is what they call Samba?!)).  The mount appears under Places in the File Browser.  The problem is you can’t get to this area via the command line.  I executed updatedb and then locate to see if a file that only appears on the samba share might help me find its mount point but without success.  It seems odd to me that Feodra could mount a volume but not expose it to the command line.

Beware: alias command in Fedora 8

I’d been doing a lot of work in Fedora 8’s Terminal.  I’m copying files often.  My work with cp caused me to get the overwrite prompt frequently and in an effort to increase productivity I was looking for a way to supress it.  The option I needed was --force.  When I invoked cp with -f it was still prompting me to overwrite the file.  Hmmm. What do I not understand about force?  I sheepishly asked a colleague what is doing on.  He said to type alias and see what I get.  Low and behold alias has cp='cp -i' effectively negating my -f.  Ugh.  Going direct with /bin/cp -f bypasses the alias.  Editing the alias is an option too.

Don’t Use mount in the Destination Directory

After rebooting this morning, I went to re-establish the link between Fedora 8 and Mac OS X 10.5.5.  I went to the mount point, /mnt/macshare, and issued the mount command: mount -o username=sambauser // /mnt/macshare   

After entering the password I issued an ls -l and saw nothing - no files.  After checking permissions, capitalization, and the Samba setup on the Mac, I decided to blindly cd to a directory in the share I knew existed and issued ls -l and it worked!  I returned to the parent directory with .. and issued ls -l and all my files were there.

Also, anyone know why the -o option username isn’t in the man page for mount?

Windows Large Font == Fedora Font DPI

Shortly after I changed the Screen Resolution in Fedora 8 something happened that robbed me of all my new pixels.  The usable portion of my desktop and windows was greatly reduced.  The phenomena reminded me of Windows Large Font mode.  It can be fixed in System->Preferences->Look and Feel->Appearance. In the Appearance preference click on the Fonts tab; Details… and change the dots per inch (DPI) resolution.  Mine got changed to 166.  Not sure what the original value was but changed it to 96 and am much happier with the results.

Fedora 8 Screen Resolution

There are two places in Fedora 8 to change the screen resolution.  One works and one doesn’t work (at least for me while running under VMWare Fusion).  Select System->Preferences->Hardware->Screen Resolution to change the resolution – this worked for me.  The area that doesn’t work is in System->Administration->Display.

Hello, World!

This is not a “me too” blog.  You will only find original content here.  Usually some issue that took me a while to piece together and I wanted to give back to the Internet in hopes that someone else will benefit.  My background is in software and firmware development.  I have been a heavy user of Mac OS X and Windows XP.  Dipping my toe into Linux with Fedora 8.  My current rig is a MacBook Pro 17″ with 4GB of RAM so I can concurrently run XP and Fedora 8 in VMWare Fusion.

Musings of a software engineer in Silicon Valley