If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: Can't seem to run a program from a service. Any ideas why?

Thanks, Arjay.
More than 500 lines of code just to run a program + additional hundred in the comments to clean up the result, come on, man

Well considering you are in a different desktop and have to find the correct desktop for the user, is it really that bad?

Let me get this straight, are you complaining because there are lots of comments?

You know of course that you aren't suppose to just cut & paste the msdn snippets into your source code, right? (because nothing says "amateur" more than running across source code that is an obvious cut and paste job).

Re: Can't seem to run a program from a service. Any ideas why?

Well, I just killed 4 hours trying to make this sample work. For some stupid reason the CreateProcessAsUser was throwing an exception from within and I couldn't figure out why. It took me several times to reread their documentation to see that this API may modify the lpCommandLine parameter in a unicode build and it cannot be const like they put it in their dumb sample. There must have been a bunch of "professionals" at Microsoft who wrote it. Good point Arjay...

Re: Can't seem to run a program from a service. Any ideas why?

Originally Posted by ahmd

Well, I just killed 4 hours trying to make this sample work. For some stupid reason the CreateProcessAsUser was throwing an exception from within and I couldn't figure out why. It took me several times to reread their documentation to see that this API may modify the lpCommandLine parameter in a unicode build and it cannot be const like they put it in their dumb sample. There must have been a bunch of "professionals" at Microsoft who wrote it. Good point Arjay...

This is part of the learning curve. No sample is perfect, but there's no need to blame Microsoft.

Btw, you can be part of the solution by pointing out the error in the sample documentation. You'll notice that at the bottom of the documentation there is a place where you can send feedback to Microsoft. You just might get it fixed for the next guy.

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.