471,318 Members | 1,988 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,318 software developers and data experts.

Running a socket server program at Windows XP startup

I am trying to have a server program that runs at startup and accepts several
commands from the clients. One of the commands is to play an audio file. I am
using Microsoft.DirectX.AudioVideoPlayback.Audio class for that purpose.

My problem is whenever I send a command to the program windows gives an
error related to the directX, and shuts down the program. However if I run
the program manually after the startup it works just fine. I have placed a
registry file under
MyComputer\HKEY_LOCAL_MACHINE\Software\Microsoft\W indows\CurrentVersion\Run
subkeys. I have tried putting my program to sleep, using
Microsoft.DirectX.AudioVideoPlayback.Audio everytime I use the class instead
of a Header file, but none worked. Is there a way to overcome this problem?
Feb 13 '06 #1
4 1968
Not sure but it may have to with a service not having an actual desktop that
it is running on? What I mean is that services cannot interact with the GUI
but DirectX does? Maybe that is the error you are getting?

Maybe post teh error you got?

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Charles Cox
VC/VB/C# Developer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

"duzinga" <du*****@discussions.microsoft.com> wrote in message
news:CC**********************************@microsof t.com...
I am trying to have a server program that runs at startup and accepts
several
commands from the clients. One of the commands is to play an audio file. I
am
using Microsoft.DirectX.AudioVideoPlayback.Audio class for that purpose.

My problem is whenever I send a command to the program windows gives an
error related to the directX, and shuts down the program. However if I run
the program manually after the startup it works just fine. I have placed a
registry file under
MyComputer\HKEY_LOCAL_MACHINE\Software\Microsoft\W indows\CurrentVersion\Run
subkeys. I have tried putting my program to sleep, using
Microsoft.DirectX.AudioVideoPlayback.Audio everytime I use the class
instead
of a Header file, but none worked. Is there a way to overcome this
problem?

Feb 13 '06 #2
Here is the error visual C# 2005 gave me:
LoaderLock was detected
Message: DLL
'C:\WINDOWS\assembly\GAC\Microsoft.DirectX.AudioVi deoPlayback\1.0.2902.0__31bf3856ad364e35\Microsoft .DirectX.AudioVideoPlayback.dll'
is attempting managed execution inside OS Loader lock. Do not attempt to run
managed code inside a DllMain or image initialization function since doing so
can cause the application to hang.

And that's what is precisely happening at the startup. But I could not
figure out how to solve this issue.

Thanks for the help.

"C.C. (aka Me)" wrote:
Not sure but it may have to with a service not having an actual desktop that
it is running on? What I mean is that services cannot interact with the GUI
but DirectX does? Maybe that is the error you are getting?

Maybe post teh error you got?

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Charles Cox
VC/VB/C# Developer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

"duzinga" <du*****@discussions.microsoft.com> wrote in message
news:CC**********************************@microsof t.com...
I am trying to have a server program that runs at startup and accepts
several
commands from the clients. One of the commands is to play an audio file. I
am
using Microsoft.DirectX.AudioVideoPlayback.Audio class for that purpose.

My problem is whenever I send a command to the program windows gives an
error related to the directX, and shuts down the program. However if I run
the program manually after the startup it works just fine. I have placed a
registry file under
MyComputer\HKEY_LOCAL_MACHINE\Software\Microsoft\W indows\CurrentVersion\Run
subkeys. I have tried putting my program to sleep, using
Microsoft.DirectX.AudioVideoPlayback.Audio everytime I use the class
instead
of a Header file, but none worked. Is there a way to overcome this
problem?


Feb 13 '06 #3
Sounds like it is because a service does does not have access to the GUI.
You will probably have to look at a different media player (one that does
not require GUI stuff).

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Charles Cox
VC/VB/C# Developer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

"duzinga" <du*****@discussions.microsoft.com> wrote in message
news:9A**********************************@microsof t.com...
Here is the error visual C# 2005 gave me:
LoaderLock was detected
Message: DLL
'C:\WINDOWS\assembly\GAC\Microsoft.DirectX.AudioVi deoPlayback\1.0.2902.0__31bf3856ad364e35\Microsoft .DirectX.AudioVideoPlayback.dll'
is attempting managed execution inside OS Loader lock. Do not attempt to
run
managed code inside a DllMain or image initialization function since doing
so
can cause the application to hang.

And that's what is precisely happening at the startup. But I could not
figure out how to solve this issue.

Thanks for the help.

"C.C. (aka Me)" wrote:
Not sure but it may have to with a service not having an actual desktop
that
it is running on? What I mean is that services cannot interact with the
GUI
but DirectX does? Maybe that is the error you are getting?

Maybe post teh error you got?

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Charles Cox
VC/VB/C# Developer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

"duzinga" <du*****@discussions.microsoft.com> wrote in message
news:CC**********************************@microsof t.com...
>I am trying to have a server program that runs at startup and accepts
>several
> commands from the clients. One of the commands is to play an audio
> file. I
> am
> using Microsoft.DirectX.AudioVideoPlayback.Audio class for that
> purpose.
>
> My problem is whenever I send a command to the program windows gives an
> error related to the directX, and shuts down the program. However if I
> run
> the program manually after the startup it works just fine. I have
> placed a
> registry file under
> MyComputer\HKEY_LOCAL_MACHINE\Software\Microsoft\W indows\CurrentVersion\Run
> subkeys. I have tried putting my program to sleep, using
> Microsoft.DirectX.AudioVideoPlayback.Audio everytime I use the class
> instead
> of a Header file, but none worked. Is there a way to overcome this
> problem?


Feb 13 '06 #4
It turns out that I was only using the filename to open the audio file since
I had it in the same folder with my executable. Changing that with the full
path of the audio file solved the problem.

Thanks a lot for the comments

Feb 14 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Brian Roberts | last post: by
17 posts views Thread by Danieltbt05 | last post: by
2 posts views Thread by ne.seri | last post: by
4 posts views Thread by tshad | last post: by
reply views Thread by =?Utf-8?B?QWxwZXIgQUtDQVlPWg==?= | last post: by
6 posts views Thread by ahlongxp | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.