Calling Dll Problem

  • Thread starter Barry Sanderson
  • Start date
B

Barry Sanderson

I'm having a problem calling a .dll file from asp. Here is the
situation:

I'm creating a web enabled mp3 app that uses windows messaging to control
winamp. To this end I've made a dll that controls the basic functions of
winamp that works fine out of VB6, but seems to freeze any asp web app
that tries to call it.

When I create the .DLL file it compiles and registers just fine. In VB6
I use the following code to call it and it seems to work great.

Dim test As New WinampControl.Commands
Private Sub Command1_Click()
test.Play
End Sub

Private Sub Command2_Click()
test.StopPlaying
End Sub

Private Sub Command3_Click()
test.Pause
End Sub

Using ASP, I'm using code snippets like this:
<%
set Winamp = server.createObject ("WinampControl.commands")
Winamp.play()
%>
.....HTML stuff follows

When I hit the web page it tries to load forever and doesn't start
playing or otherwise control winamp. In my testing, it seems to freeze
on the "Winamp.play" line of code, so it seems to recognize the .dll, but
not any of the commands. In theroy, it should start playing winamp on my
local webserver.

I would like this app to be web enabled so I can control my jukebox via
any computer in my house, or even via a wireless pda. Can anyone tell me
what might be going on?




--
 
A

Alex G

I haven't got a clue at what the problem could be, but i would suggest
adding a simple function to the dll to test if the ASP page is
recognizing it properly. The only other thing I would check is that
"Play" isn't some sort of reserved word or something.
 
M

Mark Schupp

Is the component intended to control winamp on the web-server or on the
client's system?
 
B

Barry Sanderson

Its supposed to control winamp on the server. I'll have my speakers and
everything set up on the server. I'll only be connecting through my local
intranet in my house, so this should work fine.
 
C

Carl Revell

Yes, initially you need to ensure that you are able to correctly instantiate
and call the DLL from ASP so add a simple Test method that returns a string
maybe and display it from your ASP page just to check that side of things is
working.
 
B

Barry Sanderson

Sure. Here it is:

This is the dll call from VB6 (which works fine)

Dim test As New WinampControl.Commands
Private Sub Command1_Click()
test.Play
End Sub

Private Sub Command2_Click()
test.StopPlaying
End Sub

Private Sub Command3_Click()
test.Pause
End Sub

And here it is from ASP (which doesn't work).
<%
set Winamp = server.createObject ("WinampControl.commands")
Winamp.play()
%>

I can post the DLL code, but its much larger, and I'm fairly certain
thats not where the problem is since it works in VB.
 
M

Mark Schupp

Probably your component requires that a window exist in order to work. This
generally won't work from ASP.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top