Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Ruby DL Setup to send and receive windows messages?

Reply
Thread Tools

Ruby DL Setup to send and receive windows messages?

 
 
awertyui@gmail.com
Guest
Posts: n/a
 
      05-02-2005
I am trying to send and receive messages between a ruby program and
another program. The end goal is to be able to send a message to the
other program to request data and the other program returns a message
saying where the data file is using Atom tables. Could anyone point me
in the right direction? I have been trying to use ruby dl but I never
seem to set it up right with anyting more complicated than the sleep
function. I always get this error "unexpected type 'W'" or one
similar to it. Here is what I have been trying so far with no luck.


require 'dl/import'
require 'dl/struct'
require 'dl/types'

module Win32
extend DL::Importable
dlload 'user32.dll'

typealias "WPARAM", "UINT"
typealias "LPARAM", "UINT"

POINT = struct [
"ULONG x",
"ULONG y"
]


MSG = struct [
"HWND hwnd",
"UINT message",
"WPARAM wParam",
"LPARAM lParam",
"DWORD time",
"POINT pt"
]

typealias "LPMSG","MSG*"
extern 'BOOL PeekMessage(LPMSG,HWND,UINT,UINT,UINT)'
extern 'UINT SendMessage(HWND,UINT,WPARAM,LPARAM)'


end
line = gets

 
Reply With Quote
 
 
 
 
Takaaki Tateishi
Guest
Posts: n/a
 
      05-03-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> POINT = struct [
> "ULONG x",
> "ULONG y"
> ]
>
>
> MSG = struct [
> "HWND hwnd",
> "UINT message",
> "WPARAM wParam",
> "LPARAM lParam",
> "DWORD time",
> "POINT pt"
> ]


As the type POINT can't be defined internally, you can't use it in the definition of "MSG".
I think the following definition will do for the purpose.

MSG = struct [
"HWND hwnd",
...
"ULONG pt_x",
"ULONG pt_y",
]

--
Takaaki Tateishi <(E-Mail Removed)>



 
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
Windows Live Mail: Send/Receive? Artreid Computer Support 2 04-21-2010 06:31 PM
Re: Can we send and receive data to and from Port Using Python ? Steve Holden Python 0 04-11-2008 12:52 PM
Send and receive information between Excel/VBA and C jari.toukkari@jippii.fi C Programming 9 12-26-2007 07:49 PM
Help needed to send and receive mails through Perl in Windows kowtham@gmail.com Perl Misc 1 06-27-2007 03:32 PM
Ruby DL Setup to send and receive windows messages? awertyui@gmail.com Ruby 0 05-02-2005 04:53 PM



Advertisments