Registering an extension in Windows 7

Posted on 2010-01-09
Medium Priority
Last Modified: 2013-12-03
I've had a C++ (MFC VC 6.0) application running for years.

As part of it, it registers the .fre extension to the application. The .exe is in a folder in C://Program Files.

Under Windows 7, it installs normatlly, but the registration code doesn't seem to work. The system doesn't seem to know about the .fre extension after it runs.

I've included the code below. What do I need to change to work under W7 ?

CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
  IDR_WINFRETYPE,      // Winfree\nF00_\nWinfree Document\n\\
            //Winfree Files (*.fre)\n.fre\nWinfreeFile\nWinFree File
  RUNTIME_CLASS(CMDIChildWnd),        // standard MDI child frame
RegisterShellFileTypes( );                  // added to register .fre
Question by:DickStone
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 49

Expert Comment

ID: 26276121
It should work under Win7.  I suggest that you see how far (if at all) it got by using RegEdit.  Look in HKCR for .fre  and the actual commad etc, should be under frefiles
The most common problem with Win7 is the UAC  -- it prevents non-administrators from monekying with the registry.  You should set up the file associations during installation so the user will not need to promote to administrator during each run.

Author Comment

ID: 26277510
I don't know how to change the installation to register the .fre file at the location of the .exe.

I'm attaching the InstallShield script if you can help with this...

Also, this script might also be having installation problems with W7 (64 bit), but I'm not sure.
LVL 49

Accepted Solution

DanRollins earned 2000 total points
ID: 26281881
One possibility from http://msdn.microsoft.com/en-us/library/538tbk4a(VS.71).aspx 
e registration database already associates a given filename extension with another file type, no new association is created. See the CDocTemplate class for the format of strings necessary to register this information.
Check to see if the .FRE file extension has been put in place by a different program (perhaps an older version of your own program).
Another thing to try:
Use the ClassWizard to create base-minimal MDI project.  In the Wizard, set the file type to XYZ (or some other file extension that is not registered -- again, I urge you to use RegEdit to check out the HKCR section).
Run the program on the problem platform and see if XYZ files are correctly registered for you.  If so, then the problem may be with the format of your IDR_WINFRETYPE string in your resource file.  Note: There can be more than one of these, depending on the national language.  Compare your string to the one the ClasssWizard creates for your testing program.

Author Comment

ID: 26341197
Do you know someone that is strong on InstallShield that I could pay to update the installation file for me for (1) adding registration, (2) fixing 64 installation issues?

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question