Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > wierd problems with Win32API and dlls

Reply
Thread Tools

wierd problems with Win32API and dlls

 
 
Chris Harpum
Guest
Posts: n/a
 
      06-20-2008
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','AudioContextInitializ e',[''],'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

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Python, the Win32api, and directing input to game clients darkstorme Python 0 04-02-2009 10:49 PM
Problems downloading and installing win32api brianrpsgt1 Python 2 09-09-2008 01:31 AM
os.unlink() AND win32api.DeleteFile() rbt Python 4 01-24-2006 01:17 PM
Win32API and frozen objects? Daniel Berger Ruby 0 06-11-2005 04:24 AM
Erratic Sever Side Script Debugging ASP 3.0/.NET DLLs: Problems and Solution ZMan ASP .Net 0 02-17-2004 12:08 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57