Re: Challenge: Build a Color-Coded Log Viewer for Phix/Euphoria (Inspired by chat.exw)

new topic     » goto parent     » topic index » view thread      » older message » newer message

I tested this with a trivial example:

Pascal Code:

library hello_export; 
 
uses 
  Classes, SysUtils; 
 
{$H+} 
 
function say_hello(): PChar; 
begin 
  Result := 'Hello from FreePascal DLL!'; 
end; 
 
exports 
  say_hello; 
 
begin 
end. 
 

And the Euphoria that runs it:

include std/dll.e  
include std/machine.e  
include std/pretty.e  
include std/filesys.e  
 
sequence dll_name = "hello_export.dll" 
printf(1, "loading dll: %s\n", {dll_name}) 
atom lib = open_dll(dll_name)  
atom hello = define_c_func(lib, "say_hello", {}, C_POINTER) 
atom ptr = c_func(hello, {})  
sequence msg = peek_string(ptr) 
printf(1, "Returned from DLL: %s\n", {msg}) 

My only proof it works:

Owner@DESKTOP-VHI2MMV MINGW64 /c/dev/fpc_units/simple_dll 
$ eui hello_eu.ex 
loading dll: hello_export.dll 
Returned from DLL: Hello from FreePascal DLL! 

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu