views:

114

answers:

2

I downloaded the PhotoView reference app for Win7 with source. The app works, but I can't get the project to build.

There is a ServiceControlInterop C++ project in the solution that won't build. I figured out that it needed the Win7 SDK, which I downloaded, but now that I've got the proper winsvc.h referenced I get a slew of new errors. I'm far from an adept C++ developer, so I'm hoping this list will call out something obvious to some C++ guru:

UPDATE: anelson was exactly correct, adding those paths allowed me to compile the ServiceControlInterop project.

For those interested, you'll also need the UACHelpers project and the Microsoft.KtmIntegration class to get the whole solution to compile, it's quite a beast. Add the UACHelpers project to the solution and create a new project for the Microsoft.KtmIntegration class (the link is to a code listing on MSDN... I think it must be a supporting class they forgot to include with the PhotoView source.)

Error   13 error C2065: 'NETWORK_MANAGER_FIRST_IP_ADDRESS_ARRIVAL_GUID' : undeclared identifier C:\Program Files\Microsoft SDKs\Windows\v7.0\include\Winsvc.h 313 ServiceControlInterop (Windows7Plugins\TrigerStartService\ServiceControlInterop)
Error   14 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files\Microsoft SDKs\Windows\v7.0\include\Winsvc.h 318 ServiceControlInterop (Windows7Plugins\TrigerStartService\ServiceControlInterop)
Error   15 error C2078: too many initializers C:\Program Files\Microsoft SDKs\Windows\v7.0\include\Winsvc.h 318 ServiceControlInterop (Windows7Plugins\TrigerStartService\ServiceControlInterop)
Error   16 error C2065: 'NETWORK_MANAGER_LAST_IP_ADDRESS_REMOVAL_GUID' : undeclared identifier C:\Program Files\Microsoft SDKs\Windows\v7.0\include\Winsvc.h 321 ServiceControlInterop (Windows7Plugins\TrigerStartService\ServiceControlInterop)
Error   17 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files\Microsoft SDKs\Windows\v7.0\include\Winsvc.h 326 ServiceControlInterop (
+2  A: 
anelson
A million thanks, I will try this tonight and accept...
Dave Swersky
What can I say, you da man.
Dave Swersky
Cool, glad it worked.
anelson
A: 

For x64 if you downloaded the x86 install your best bet is to just do a 32 bit build. Use configuration manager to switch to x86, rebuild, all the references etc that you need are there. No jumping through hoops to find KtmIntegration, UacHelper and the like. You probably do need the SDK and to have integrated it to VS - either as described in the other answer or by using the tool you can reach from the Start menu. (I had the SDK already and had integrated it, so I can't prove it wouldn't work without it, but the documentation says you need it to compile the C++ parts.)

If you don't mind re-downloading, an updated version was released Jan 27 - http://code.msdn.microsoft.com/XP2Win7/Release/ProjectReleases.aspx?ReleaseId=2977. No SQL dependency, plus both an x86 and x64 install.

Kate

Kate Gregory