wierd problems with Win32API and dlls

C

Chris Harpum

i am currently developing a more advanced audio and input system for the
ruby / gosu package and ive come across a strange problem with the audio
dll im using.
(The dll was created by a friend for his game but given to me to allow
me to further my system so i dont have the source code)
I have created the audio system before on rpgmaker xp (dont laugh... its
what got me into ruby back in the day) and was transfering it across on
my friends windows vista... everything was good there (except it needed
to loop the context creation process about 40 times to create it
properly - but thats understandable and worth it as it only needs to be
done on first startup) but when i moved the code back to my xp the
system doesnt work anymore. I have no idea why this is happening but the
context creation returns 0 which is a return error (it should return the
handle to a created audio stream). If possible would someone be able to
look at the dll (attached) and tell me what is wrong with this code:

require 'Win32API'
alias oldprint print
def print(*args)
Win32API.new('User32','MessageBox',['i','p','p','i'],'i').call(0,args.to_s,'test',0)
end
alias p print
begin
loop do
print 'attempting to create context'
@context =
Win32API.new('MCEAudio.dll','AudioContextInitialize',[''],'l').call
if @context != 0
break
end
end
print 'context created successfully - WIN!'
rescue Exception => error
print "an error occured but shouldn't have - the error is: #{error}"
end

all that happens is the context will not be created correctly and will
try to be made again... i added my edited messaging system incase of an
error... its much easier to read it if it doesnt close down instantly.

i hope someone can find out whats wrong as this is REALLY important...

Attachments:
http://www.ruby-forum.com/attachment/2231/MCEAudio.dll
 

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,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top