Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > from "int cfunc(char *data,int *num) " how can I get the value of'num' in ruby/dl ?

Reply
Thread Tools

from "int cfunc(char *data,int *num) " how can I get the value of'num' in ruby/dl ?

 
 
bbmerong
Guest
Posts: n/a
 
      01-18-2008
I have a question about "ruby/dl".

I define the function in "ruby/dl" like the belows


--------------------------------------
require 'dl'
LIB=DL.dlopen('libfunc.dll')
cfunc=LIB['cfunc','ISi'] # int cfunc(char *data,int *num)
---------------------------------------


After typing in irb, I typed them like this.


len=DL.malloc(DL.sizeof("I"))
err=cfunc.call("hello",len)


But, error message is displayed like the belows.


"TypeError: can't convert DL:trData into Integer"


I'm not sure how to solve the problem.

It makes me annoying


Please let me know the reason and solutions for novice like me.


Then, Thank you in advance.


 
Reply With Quote
 
 
 
 
Jason Roelofs
Guest
Posts: n/a
 
      01-18-2008
[Note: parts of this message were removed to make it a legal post.]

Stop posting the same thing. If you don't get an answer, maybe you need to
restate your question.

Jason

On Jan 17, 2008 10:19 PM, bbmerong <> wrote:

> I have a question about "ruby/dl".
>
> I define the function in "ruby/dl" like the belows
>
>
> --------------------------------------
> require 'dl'
> LIB=DL.dlopen('libfunc.dll')
> cfunc=LIB['cfunc','ISi'] # int cfunc(char *data,int *num)
> ---------------------------------------
>
>
> After typing in irb, I typed them like this.
>
>
> len=DL.malloc(DL.sizeof("I"))
> err=cfunc.call("hello",len)
>
>
> But, error message is displayed like the belows.
>
>
> "TypeError: can't convert DL:trData into Integer"
>
>
> I'm not sure how to solve the problem.
>
> It makes me annoying
>
>
> Please let me know the reason and solutions for novice like me.
>
>
> Then, Thank you in advance.
>
>
>
>


 
Reply With Quote
 
 
 
 
Ken Bloom
Guest
Posts: n/a
 
      01-18-2008
On Thu, 17 Jan 2008 22:23:52 -0500, Jason Roelofs wrote:
> Stop posting the same thing. If you don't get an answer, maybe you need
> to restate your question.


Calm down. The same message, posted two minutes apart, probably means a
mail server hiccuped somewhere along the line, and probably doesn't mean
the poster had any intention to be rude or pushy.

--Ken
(Who finally got his mail unstuck yesterday after nobody recieved the
emails he sent for over a week.)

--
Ken (Chanoch) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/
 
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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
stl map: get the <key,value> pair which has the minimum value Rui Maciel C++ 2 12-01-2009 11:21 PM
Get ubuntu ! Get ubuntu ! Get ubuntu ! Get ubuntu ! Getubuntu Windows 64bit 1 06-01-2009 08:54 AM
how do I get the value for the value in the radio buttons inside t Eskimo ASP .Net Web Controls 0 02-07-2005 05:07 PM
how to get value from page.asp?value=myvalue Mike Brearley ASP General 1 05-14-2004 07:54 PM



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