1

I'm using the XNA library for image processing in GPU. All this must be done as a Windows Service (not forms).

When I create a GraphicsDevice, it requires a WindowsHandle. But the WindowService doesn't have a WindowsHandle. Even when the "window form" is created from the service, GraphicsDevice isn't created.

How to set the WindowsHandle for GraphicsDevice in WindowService?

Sorry for bad English.

Diogo Muller
  • 139
  • 1
  • 8
  • What have you tried so far? If you aren't constructing your GraphicsDevice using the GraphicsDeviceManager there is quite a bit of extra work you will have to do. – Timothy Randall Apr 12 '13 at 14:19

1 Answers1

0

You're not supposed to (can't?) create forms from a service. You certianly cannot access the GPU, due to Session 0 Isolation.

Consider using auto-login and a standard desktop app. You can create an invisible form and bind the graphics device to that.

Andrew Russell
  • 26,924
  • 7
  • 58
  • 104