|
Welcome,
Guest
|
Create file association?
(1 viewing) (1) Guest
|
TOPIC: Create file association?
Create file association? 5 years ago #79
|
Hi, a bit of information and a request... Just worked out how to use PocketPC Installation Creator to create file associations. You need to set 4 registry entries, for example (modified from www.devbuzz.com/content/zinc_evb_icon_assoc_pg2.asp):
[RegEntrys]
HKCR,.mrb,,,mrbfile
HKCR,mrbfile,,,MyFileDescription
HKCR,mrbfile\DefaultIcon,,,\"%InstallDir%\MyEVBLauncher.exe,0\"
HKCR,mrbfile\Shell\Open\Command,,,\"\"\"\"%InstallDir%\MyEVBLauncher.exe\"\" %%1\"
To get this into your project in PPIC use the Registry and Shortcuts part of the PocketPC Side section. Hit 'Edit Registry Sections' (Nick - typo in your button name here!) and select 'Add', then give the section a name (in this case 'RegEntrys'). Then fill out the key details dialog box as follows:
Entry 1:
Registry Root Key: HKEY_CLASSES_ROOT
Subkey: .mbr
Value Name: (leave blank)
Value: mbrfile
Hit OK, and then 'Add' to create the next section
Entry 2:
Registry Root Key: HKEY_CLASSES_ROOT
Subkey: mbrfile
Value Name: (leave blank)
Value: MyFileDescription
Hit OK, and then 'Add' to create the next section
Entry 3:
Registry Root Key: HKEY_CLASSES_ROOT
Subkey: mrbfile\DefaultIcon
Value Name: (leave blank)
Value: \"%InstallDir%\MyEVBLauncher.exe,0\"
Hit OK, and then 'Add' to create the next section
Entry 4:
Registry Root Key: HKEY_CLASSES_ROOT
Subkey: mrbfile\Shell\Open\Command
Value Name: (leave blank)
Value: \"\"\"\"%InstallDir%\MyEVBLauncher.exe\"\" %%1\"
Then go back to the main screen and add the section to the installation details for you platform(s). Hope this is of use to someone out there! Also Nick feel free to use this in your documentation. Finally a request - could a function to do this automatically be created so the registry entries don't have to be entered manually? (Edit 2007-05-11 to fix missing backslash chars) (Edit 2007-05-16 to change HKLM to HKCR in example!) |
|
|
Re:Create file association? 5 years ago #83
|
Thanks for the guide
And, yes it is a very good idea for a feature ... In the next version it will be added ... Regards, Nick Protopapas |
|
|
Re:Create file association? 5 years ago #95
|
All done
Added the automatic file association feature. See here for more info: www.aperitto.com/component/option,com_ku...ew/catid,9/id,92/#92 Regards, Nick Protopapas |
|
|
Re:Create file association? 5 years ago #97
|
Hi Nick, have tested the new features and it all looks pretty good! The file association thing did turn up something interesting in my code though to do with quote marks and the CFile::Open operation.
Originally the open registry entry in HKCR I had was \"exe path\exe name.exe\" %1With your new built-in function it ends up as: \"exe path\exe name.exe\" \"%1\"And my code worked with the first reg entry but not the second - basically it grabs the command line and passes it to the MFC CFile::Open command. The extra quote marks result in the command line being passed to the open function surrounded in quote marks: \"\My Documents\file name.ext\"Rather than: \My Documents\file name.extOn the PC platform it works the same way as your function - it passes the command line with the quote marks and the CFile::Open command works fine. However it seems to fail on the PocketPC platform. Easy fix, I just modified my application to strip quote marks if present from the command line before passing it to the CFile::Open function on the PocketPC platform only. Looking at other entries in the HKCR part of the registry it seems the quote marks are not normally used. So something to be aware of - but not sure if there is actually anything wrong with the way you have implemented this! |
|
|
Re:Create file association? 5 years ago #98
|
yes, this is the point of the quote marks.
The \My Documents\file name.extis parsed as three different parameters:
1. \My
2. Documents\file
3. name.ext
So if you enclose the file parameter into quote marks, then is parsed as only one parameter, but you must strip the marks into your program. I think that is standard for windows, the quote marks. But if one doesn't want them, simply can edit the generated registry entries. With this version I think it is more human understable the registry edit Regards, Nick Protopapas |
|
|
Re:Create file association? 5 years ago #99
|
Ahh, I've worked out why this is causing a problem for me. I process the command line directly, and don't break it up using spaces as a seperator for the CE build of my app.
So you are right, using the quote marks is the 'proper' way of doing things. Oh and definitely like the new registry editing dialogs! |
|
|
|
Time to create page: 0.28 seconds