Re: passing strings to .DLL calls --- (Help!)
- Posted by Daniel Berstein <daber at PAIR.COM> Jun 29, 1998
- 561 views
-----Original Message----- De: JesusC - Jesus Consuegra <jconsuegra at REDESTB.ES> Para: EUPHORIA at cwisserver1.mcs.muohio.edu <EUPHORIA at cwisserver1.mcs.muohio.edu> Fecha: lunes 29 de junio de 1998 18:51 Asunto: passing strings to .DLL calls --- (Help!) >Robert, David, Pete, Daniel, Irv,... or any other expert in interfacing to >windows .DLLs: > >A basic question on DLL interfacing: > >I see clearly that when I have to pass a "C" structure to a routine inside a >DLL, I have to allocate some memory space, and poke in the desired values. >The same when I need to get some data from inside an structure. >But, what does happen with sequences?. Are sequences equivalent to >C_POINTER?. >How should I pass a sequence to a .DLL string?. And backwards?. You can't pass an Euphoria sequence just like that. But if you want to pass a string, implemeted in Euphoria as a one dimension sequence, you can do it easily by just allocating length(s)+1 bytes (s is your string) and poking to the allocated memory your string, ending with a 0 (zero), that's why you need to allocate +1 bytes ;) You then give the dll functions the address of the allocated memory as the parameter. Regards, Daniel Berstein daber at pair.com