From: Chris Harpum Date: 2008-06-21T03:09:34+09:00 Subject: wierd problems with Win32API and dlls 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 -- Posted via http://www.ruby-forum.com/.