473,574 Members | 13,331 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.Direc tX.AudioVideoPl ayback.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\Micros oft\Windows\Cur rentVersion\Run
subkeys. I have tried putting my program to sleep, using
Microsoft.Direc tX.AudioVideoPl ayback.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 2097
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*****@discus sions.microsoft .com> wrote in message
news:CC******** *************** ***********@mic rosoft.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.Direc tX.AudioVideoPl ayback.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\Micros oft\Windows\Cur rentVersion\Run
subkeys. I have tried putting my program to sleep, using
Microsoft.Direc tX.AudioVideoPl ayback.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\ass embly\GAC\Micro soft.DirectX.Au dioVideoPlaybac k\1.0.2902.0__3 1bf3856ad364e35 \Microsoft.Dire ctX.AudioVideoP layback.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*****@discus sions.microsoft .com> wrote in message
news:CC******** *************** ***********@mic rosoft.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.Direc tX.AudioVideoPl ayback.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\Micros oft\Windows\Cur rentVersion\Run
subkeys. I have tried putting my program to sleep, using
Microsoft.Direc tX.AudioVideoPl ayback.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*****@discus sions.microsoft .com> wrote in message
news:9A******** *************** ***********@mic rosoft.com...
Here is the error visual C# 2005 gave me:
LoaderLock was detected
Message: DLL
'C:\WINDOWS\ass embly\GAC\Micro soft.DirectX.Au dioVideoPlaybac k\1.0.2902.0__3 1bf3856ad364e35 \Microsoft.Dire ctX.AudioVideoP layback.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*****@discus sions.microsoft .com> wrote in message
news:CC******** *************** ***********@mic rosoft.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.Direc tX.AudioVideoPl ayback.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\Micros oft\Windows\Cur rentVersion\Run
> subkeys. I have tried putting my program to sleep, using
> Microsoft.Direc tX.AudioVideoPl ayback.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
2156
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 type and amount of status information doesn't fit nicely into a --verbose or logger -- either too little or too much information at different...
17
9207
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 16, state1 SQL server does not exist or denied access.
2
2459
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 server, server reasoned, and so on... The thing is that connection MUST always stay open. I'm using C++, and as for sockets, I'm using native syscalls,...
4
4171
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 check to see if the status is in stopped or running mode. But that doesn't tell me if it is actually running. I need to know this so that if it...
5
4752
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 set of sensor data per second to a socket server. The socket server will do two things: 1. write data into a file via bsddb; 2. forward the data to...
5
15705
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 to read data from the transport connection" when restart reading the stream with socket.BeginRead in the Sub SocketIncomingMsg. I'm debugging now for...
0
2586
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 have several problems re-establishin connection between peers. Below are my problem cases after closing of the first successfull communication; ...
6
3660
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 windows and linux. so I guess there is a problem with makefile(). # Echo server program
0
1189
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 pasting the error report ( thanks in advance) -------------------------------------------------------------------------
0
7817
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7738
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8081
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
6482
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5635
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5322
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3759
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3771
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2254
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 we have to send another system

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.