I'm trying to develop a toolbar for Microsoft Outlook. For getting it to work I need mso.dll and msoutl.olb as an import.
My problem is: the path is hardcoded , but it varies for every OS and of course if someone doesn't install Office to the default path.
I tried it this way
http://support.microsoft.com/kb/234788/en-us/
but it didn't work, because I couldn't get the return value I needed (OK, after four type conversions but I thought there had to be a better way ;) )
Thanks for helping
The path to MSO.DLL is stored under the following registry key for Office 2007:
HKLM\SOFTWARE\Microsoft\Office\12.0\Common\FilesPaths\mso.dll
The install path is also under this key:
HKLM\SOFTWARE\Microsoft\Office\12.0\Common\InstallRoot\Path
Related
I'm currently running into a problem that drives me a little bit mad. I hope it's a little stupid mistake on my side.
For convenience, I added an environmental variable in Windows 7, VS_BOOST_INCLUDE_HEADER with the value set to D:\01_Programs\boost_1_55_0\. My VC C++ include directories contain $(VS_BOOST_INCLUDE_HEADER).
Remark: I changed that variable this morning, but I've rebooted my computer since than multiple times.
Now my VS project complains it can't find any of the boost includes anymore, e.g. <boost/asio.hpp>. If I add the whole path manually to the include paths (adding D:\01_Programs\boost_1_55_0\ as text to my VC C++ include directories), everything works as expected.
To avoid a simple typo, I added a post-build event:
echo $(VS_BOOST_INCLUDE_HEADER)
That works as expected:
1>PostBuildEvent:
1> D:\01_Programs\boost_1_55_0\
All my other environmental variables still work as expected, even those that were renamed this morning as well.
Any ideas?
What am I doing wrong?
Maybe I'm late to the party, but a possible scenario is when you
run VS as administrator
adjusted a User environment variable
Then it would make some sense for VS to see the System environment only and still use the old value.
If you decide to use property sheets the msdn has clear docs
"If you have a common, frequently used set of properties that you want
to apply to multiple projects, you can use Property Manager to capture
them in a reusable property sheet file"
Under the view menu, chose property manager and add a new sheet.
You can then make your project inherit its settings from this property sheet, thereby just setting this in one place.
I would like to call MS PowerPoint Viewer executable(PPTVIEW.exe) from within my C++ application.
I do not wish to ask the user, where MS PowerPoint viewer is installed. I believe, it is not professional and relies on user making appropriate input. Instead, I would like to be able to identify the location of the installation directory on my own.
For example, the default location of MS PowerPoint Viewer 2007 is the following:
c:\program files\microsoft office\office12\PPTVIEW.exe
This of course does not have to be always true, especially different versions (2003, 2007, 2010) have have different locations.
Would you advise, please, where to get the correct path, and even better, to be able to identify, if MS PowerPoint viewer is not installed at all?
There must be something in the registry, but which key is the correct one?
I use:
Non Managed C++
Needs to be compatible with WinXP
Should be compatible with bot 32 and 64 bit OS
Should be able to identify location of Powerpoint Viewer of all the versions after 2003(including.)
Thank you.
The best solution so far i found is searching for the appropriate path in registry by reading the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\pptview.exe
The key above gives me location to where PowerPoint Viewer is installed. However, I have no clue whether this key is present in every workstation where PowerPoint Viewer is installed.
If you rephrase the question as "I would like to display a powerpoint in slideshow mode from within my C++ application." then it would be easy to achive this by querying the registered file handler and using the applicable COM object.
The following registry key will be present if there is a registered extension handler:
HKEY_CLASSES_ROOT\.pptx\
I need to enumerate paths to desktop folders for all users on a local Windows system from a service application. The catch is that some users may not be logged in at the time. So is there any API, or some other method to do that?
EDIT1: For those who didn't read the first paragraph let me repeat -- I do not have a token to a user account, a user may not be logged in at the time.
EDIT2: I need this to remove a shortcut from user desktops before a feature supported by my application is turned off, or the app is uninstalled.
Here's the best method I was able to come up so far. So I'd appreciate if someone with a non-English installation of Windows could check this for me?
(I'm posting just a pseudo-code for brevity.)
1 - All of the steps below are done from a local service application.
2 - To get paths to all user profiles enumerate subfolders in the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList key and read ProfileImagePath value from them. It will give profile paths for each user account.
3 - To get the folder name for the desktop, read the Desktop value from the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders key from the service app (yes, I know HKCU sounds strange, but it worked for me.) After that get the path for the %USERPROFILE% environment variable, using environment variable APIs. So you'll get two paths, something like this:
C:\Windows\system32\config\systemprofile\Desktop
and
C:\Windows\system32\config\systemprofile
Then simply isolate the 2nd string from the 1st, using case-insensitive comparison, and you'll get the folder name for the desktop, (i.e. "\Desktop" in this case.)
4 - Add the desktop folder to the path obtained in step 2 to produce the full path to that user's desktop folder.
From userenv.h : GetProfilesDirectory (win2k+, iirc)
msdn.microsoft.com/en-us/library/windows/desktop/bb762278(v=vs.85).aspx
Use this to find the directory containing all the local user account profile directories.
To find the desktop folder:
Shlobj.h : SHGetKnownFolderPath (vista+)
msdn.microsoft.com/en-us/library/windows/desktop/bb762188(v=vs.85).aspx
You'll need FOLDERID_Desktop as the known-folder id. This symbol is declared in Knownfolders.h
msdn.microsoft.com/en-us/library/windows/desktop/dd378457(v=vs.85).aspx
Using these, you might get closer to what you want without directly reading the registry. Of course this belies any elegant way of enumerating the users aside from inferring from the folder list within the
GetProfilesDirectory. Perhaps there is a more api appropriate way to enumerate the local users.
Secondly, and this depends on the purpose of your service, but perhaps by working with the 'allusers' profile, instead of each individually you won't need to know the current list of local users.
Can anybody help, please. How can I find out version of msword installed on computer? If there is few versions of it, find out that version which open '.doc' by default. Can anybody suggest some C++ functions or algorithm for this task? Sorry for bad english :( Thank you for help.
you can read the registry entry from the path.
for.....
Office 2003 = 11
Office 2007 = 12
Office 2010 = 14
HKLM\Software\Microsoft\Office\12.0\Word\Registration{-------------}\AccessNameVersion
HKLM\Software\Microsoft\Office\12.0\Word\Registration{-------------}\ExcelNameVersion
HKLM\Software\Microsoft\Office\12.0\Word\Registration{-------------}\OutlookNameVersion
HKLM\Software\Microsoft\Office\12.0\Word\Registration{-------------}\PowerPointNameVersion
If I want to know what version of Word, I look at the registry key HKEY_CLASSES_ROOT\Word.Application\CurVer
It will give you a ProgId like: "Word.Application.14", "Word.Application.12", or "Word.Application.11" for Office 2010, 2007, and 2003 respectively. The part to the right of the last "." gives the version. If you look at "Word.Document", it won't always give the correct answer because there are feature packs that can be installed that will allow an older version of Word to read a new version of Word document. These feature packs update some registry settings for Word.Document, but they leave Word.Application alone.
Please don't go rummaging through the registry when there are APIs available. Using the appropriate APIs will help make sure your test works for all versions of Windows and Word.
To find out which executable is registered to handle a certain file type (like .doc), use AssocQueryString. Once you have the path to the executable, you can check its version number using GetFileVersionInfo and VerQueryValue.
If you just want to find out which versions are installed (regardless of which application is associated with .doc), you can probably query Windows Installer. Check out MsiEnumProductsEx and MsiGetProductInfo.
There's probably also a way to query for this stuff using WMI.
I want to make a program that moves certain named folders (and all files contained) from directory A to directory B. It was suggested to code in C++. So I was wondering if anyone knew of a simple way to do this, if they could give me a link, and if anyone know's where it's possible to set the directories as variables that can be loaded from a text file. I'm asking this question, because I want to basically have all my program settings and whatnot from the appdata folder since I move between computers alot, be easily transferable.
settings.txt (This is an example of what I mean.)
fldrget = (Folder Name)
fldrdir = (Path to Folder)
fldrplc = (Folder Destination)
Would creating an xml document be a better idea as far as the txt document goes?
Additional Information: OS: Windows(XP, Vista, 7) and I'd like to make this a GUI, but as I'm not familiar with any C language, I'll settle for basics first if anyone can give me a push in the right direction.
Can you provide a bit more information? Are you wanting to write a console application or a GUI? What platform are you targeting? You could use the Win32 API, Boost, Qt, Wx, or a number of others.
You may want to look into using PowerShell. It is much more friendly for a new comer and built-in to Windows 7 and freely available for Windows XP. Just do a google search for moving a directory using PowerShell to get started