Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

DLL interfacing

 [1/3] from: robert::muench::robertmuench::de at: 1-Feb-2003 14:20


Hi, I'm trying to use a DLL that has a function signature like this: xyz_version(&major, &minor) So the paramters given to the function will be altered by VERISON and contain the result after the function call. I tried: version: make routine! [a [integer!] b [integer!]] dll xyz_version major: minor: 0 version major minor print [major minor]
>> 0 0
So the results are not returned with this method. Any idea how this can be done? Robert

 [2/3] from: robert:muench:robertmuench at: 1-Feb-2003 14:45


> -----Original Message----- > From: [rebol-bounce--rebol--com] [mailto:[rebol-bounce--rebol--com]] > On Behalf Of Robert M. Muench > Sent: Saturday, February 01, 2003 2:21 PM > To: [rebol-list--rebol--com] > Subject: [REBOL] DLL interfacing
Hi, next one (this time I don't think I answer myself ;-)) I have a C struct like this: struct mystruct { int structSize; char someText[maxTextLength]; } How does the Rebol strcut! look like for such a C struct? How can I fill in the correct structSize? Does length? on the Rebol strcut will work? Robert

 [3/3] from: robert:muench:robertmuench at: 1-Feb-2003 14:33


> -----Original Message----- > From: Robert M. Muench [mailto:[robert--muench--robertmuench--de]]
<<quoted lines omitted: 3>>
> So the results are not returned with this method. Any idea > how this can be done? Robert
Hi, I got it. I need to use structs like this: i-ref: make struct! [value [integer!]][0] And than I can call: major: make struct! i-ref [0] minor: make struct! i-ref [0] version major minor print trim to-string reduce [second major second minor]
>> 2.11
Nice! :-)) Robert

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted