Re: Noob, learning how to use dll's.
- Posted by Archarios <archarios at verizon?net> Jun 13, 2008
- 794 views
without warning include file.e include dll.e include safe.e atom file1,DLL,GMSx,mem,result object temp file1 = open("D:\obscured\test.txt","w") DLL = open_dll("kernel.dll") GMSx = define_c_func(DLL,"GlobalMemoryStatusEx",{C_POINTER},C_INT) mem = allocate(64) result = c_func(GMSx,{mem}) ----faults here printf(file1,"%d",peek(mem+1)) free(mem) close(file1) abort(0)
I get: C:\EUPHORIA\include\safe.e:516 in function original_c_func() c_proc/c_func: bad routine number (-1) i = -1 s = {832176} ... called from C:\EUPHORIA\include\safe.e:522 in function c_func() i = -1 s = {832176} r = <no value> ... called from D:\obscured\test.exw:13 Do I have to use machine.e for this, I was using safe.e since I'm new to dll's.