Re: Rob: Q: Constant Scope
- Posted by "Juergen Luethje" <j.lue at gmx.de> Apr 20, 2005
- 542 views
Brian Broker wrote: > Robert Craig wrote: >> >> I don't know how well that works in the Windows world. >> I think in Windows, it might only be routines that can be >> exported from a .dll, not variables. Maybe someone else here has tried it. > > define_c_var() works just fine with DLLs (assuming the lib actually > exports variables). I translated the most simple sample DLL that I could think of, using the official Eu 2.5 translator (compiled with Borland and Watcom) on Windows 98: ------------[ file mydll.ew ]------------
global integer foo foo = 123
----------------------------------------- ... and tested with the following code
include dll.e constant lpLib = open_dll("mydll.dll"), lpFoo = define_c_var(lpLib, "foo") ? lpLib ? lpFoo
Output is 6291456 -1 What goes wrong here? Regards, Juergen