.dll calls (newbie tutorial)
[1/4] from: depotcity::telus::net at: 10-Jun-2001 22:02
Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello. I'm revisiting api calls and such.. still can't get my head around it. I made a simple VB .dll (attached as project1.dll) the VB code is as follows... Public Function Add(ByVal Value1 As Long, ByVal Value2 As Long) As Long Add = Value1 + Value2 End Function Public Function Subtract(ByVal Value1 As Long, ByVal Value2 As Long) As Long Subtract = Value1 - Value2 End Function ... end vb ... It simply adds or subtracts two numbers. Now how do I create the proper Rebol routines to get this to work? Thanks, Terry Brownell -- Binary/unsupported file stripped by Listar -- -- Type: application/x-msdownload -- File: Project1.dll
[2/4] from: depotcity:telus at: 10-Jun-2001 22:18
Oh well, so much for the attachment. This is how I see it... a: %path/to/dll b: load/library a a-routine: make routine! [return: [integer!] value1: [integer!] value2: [integer!]] b "add" ; But I get an error "Cannot open add" ??? Terry
[3/4] from: agem:crosswinds at: 11-Jun-2001 10:23
>>>>>>>>>>>>>>>>>> Ursprüngliche Nachricht <<<<<<<<<<<<<<<<<<
Am 11.06.01, 06:18:26, schrieb "Terry Brownell" <[depotcity--telus--net]> zum Thema [REBOL] Re: .dll calls (newbie tutorial):
> Oh well, so much for the attachment. > This is how I see it... > a: %path/to/dll > b: load/library a > a-routine: make routine! [return: [integer!] value1: [integer!]
> [integer!]] b "add" > ; But I get an error "Cannot open add" ???
http://www.escribe.com/internet/rebol/m7619.html , small /library-demo by jeff. he uses [value] instead of [value1:]. have dlls a argument-list declared so your declaration is decided wrong? docu shows colon only with [return:] too.
[4/4] from: jeff:rebol at: 11-Jun-2001 8:55
Howdy, Terry: Right, just set-word on return: as Volker points out. Also, in the preceding message you named the function "Add", capital. Function names will be case sensitive. I've never used the library component against VB dlls, so I don't have anything really to add, haha, no pun intended. But if this works, I'd be interested to learn more. The safest bet has always been to use shared libraries created in C, but if VB libraries are equivalent, then it all should work given the arguments are declared in the same way that REBOL/Command is passing them. In the upcoming first issue of the REBOL/Zine there's a short article on a trick or two with the shared library component of REBOL/Command. Presses roll 15-Jun-2001, 9pm US-Pacific. :-) [Thanks folks, for the articles that have been sent in so far!! It's coming together!] -jeff