[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Win32 API Callbacks

Oky --

7/30/2006 1:09:00 PM

I want to write a Windows network audio program in pure Ruby. However,
this requires me to call an API function called waveInOpen which takes a
callback function as one of its arguments.

The callback function looks like this:

void CALLBACK waveInProc(
HWAVEIN hwi,
UINT uMsg,
DWORD dwInstance,
DWORD dwParam1,
DWORD dwParam2
);

Is it possible to achieve this in Ruby or do I have to write a wrapper
DLL?


Thanks in advance

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

3 Answers

Logan Capaldo

7/30/2006 3:00:00 PM

0


On Jul 30, 2006, at 9:09 AM, Oky -- wrote:

> I want to write a Windows network audio program in pure Ruby. However,
> this requires me to call an API function called waveInOpen which
> takes a
> callback function as one of its arguments.
>
> The callback function looks like this:
>
> void CALLBACK waveInProc(
> HWAVEIN hwi,
> UINT uMsg,
> DWORD dwInstance,
> DWORD dwParam1,
> DWORD dwParam2
> );
>
> Is it possible to achieve this in Ruby or do I have to write a wrapper
> DLL?
>
>
> Thanks in advance
>
You might be able to get away with using RubyInline to create the
callback. Still a little bit of C, but it'll be right there with the
rest of your code.

> --
> Posted via http://www.ruby-....
>


Nobuyoshi Nakada

7/31/2006 5:21:00 AM

0

Hi,

At Sun, 30 Jul 2006 22:09:24 +0900,
Oky -- wrote in [ruby-talk:204999]:
> I want to write a Windows network audio program in pure Ruby. However,
> this requires me to call an API function called waveInOpen which takes a
> callback function as one of its arguments.

DL might help you.

--
Nobu Nakada

Oky --

8/1/2006 8:06:00 PM

0

Thanks very much, i'll give them both ago.

DL looks awesome btw!

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