cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Sorenhes
Level 4

Problems with GetNotificationCollection

Hello,

I have a small C++ program that makes a call to the GetNotificationCollection method of the INotificationCollection interface to determine if any updates are available for our suite of apps. It works fine, in that it reports that updates are available, when I execute the program either from Visual Studio or when I double-click on the executable, but when I use Microsoft's SrvAny module to call my program from a service it always returns 0 updates. We use SrvAny to circumvent a problem with Windows Defender which blocked our program on Windows Vista because we try to load the said program during the boot process by adding a reference HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run registry key.

I check the return code of the call to GetNotificationCollection and it returns that the called succeeded. I can't figure out why the method does work in this context.

If anybody has any suggestions they are welcomed.

Regards

Robert
0 Kudos
(5) Replies
KellyF
Level 9

Is that service then assigned to run under the system account or a named user account? (Be sure to try with a named user)

Regards,
Kelly
0 Kudos
Sorenhes
Level 4

Hi Kelly,

The service runs under the system account.

Regards,

Robert
0 Kudos
KellyF
Level 9

Hi Robert,

For a brief test, try converting the service to run as a named user

Regards,
Kelly
0 Kudos
Sorenhes
Level 4

Hi Kelly,

I can not convert the service since I use Srvany with is supplied by Microsoft. This module in turn calls my program with make use of the FlexConnect API.

When I run the service as a named user then I get an error on the CoCreateInstance(CLSID_USAgent) instruction since the named user I used belonged to the User group.

I'll google a little more to see a solution other than the use of a service in Vista is possible.

Thanks for your help

Regards,

Robert
0 Kudos
KellyF
Level 9

Robert,

Good luck on the instantiation, I can't say I've used srvany since it was part of the Win2k ResKit, and even then I think I always ran it as a privileged user (administrator). Guess I had momentarily forgotten about Vista's UAC (though it's in my face daily 😕 ).

I won't deny that running under a service isn't something necessarily supported by Macrovision, though I wonder if you asked the support folks whether they have any experience with it.

Regards,
Kelly

P.S. I've been mostly sticking with installing Java classes as services, though I an say that I just installed my service under it seemingly without issue.
0 Kudos