473,509 Members | 2,880 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2091
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2153
by: Brian Roberts | last post by:
I have a command line Python program that sometimes takes a bit (several minutes) to run. I want to provide an optional method for an impatient user (me!) to check the status of the program. The...
17
9176
by: Danieltbt05 | last post by:
just installed SQL server 2000 and using my client , i can't locate the server. I used SQL query analyzer to search but no servers were found. Error message is as below Server : Msg17,level...
2
2458
by: ne.seri | last post by:
In short, I'm building a kind of server which is supposed to handle open connections with clients. E.g. client connects to the server, the connection stays open, client sends a request to the...
4
4158
by: tshad | last post by:
What would be a good way to check programmatically whether a service was running? We have a service that dies periodically and I need to check to see if this service is running. I know how to...
5
4744
by: zxo102 | last post by:
Hi, I am doing a small project using socket server and thread in python. This is first time for me to use socket and thread things. Here is my case. I have 20 socket clients. Each client send a...
5
15690
by: Arno | last post by:
reposted with the right microsoft managed newsgroup ID: Sorry for the inconvinience Hi, I've written a class for client-socket connection, but I get a lot of times the error message "Unable...
0
2575
by: =?Utf-8?B?QWxwZXIgQUtDQVlPWg==?= | last post by:
Hello, First of all I wish you a good day. My help request is about .NET asynchrounus socket communication. I have developed Server-Client Windows Forms .NET applications in VC++ .NET v2003. I...
6
3656
by: ahlongxp | last post by:
socket.makefile() may lose data when "connection reset by peer". and socket.recv() will never lose the data. change the "1" to "0" in the client code to see the difference. confirmed on both...
0
1186
by: shaileshkumar | last post by:
hi, iam unable to run my applications in netbeans4.1. problem may be due to JVM or port numbers conflict. i did not intentionally change any port numbers . please guide me accordingly. iam...
0
7347
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7416
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7073
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5656
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4732
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3207
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1571
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
779
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
443
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.