Re: Machine level exception with define_c_func()
- Posted by Craig Welch <craig at singmail.com> Dec 10, 2005
- 586 views
Al Getz wrote: >>The last statement fails with "A machine-level exception occurred during >>execution of this statement". >> >>Given that I've never used any C functions from Euphoria, my first >>assumption is that I've put coded the c_func() or define_c_func() >>statements wrongly. But I've gone over them and over, and tried >>different types of C variables ... without any success. >> ><snip> > >which for your code would look something like this: > >CONVERTER_Allocate = define_c_func(dll_handle, "CONVERTER_Allocate", {} >,C_POINTER) >CONVERTER_Free = define_c_func(dll_handle, "CONVERTER_Free", {C_POINTER}, >C_LONG) > > >atom ob >ob=c_func(CONVERTER_Allocate,{}) >result=c_func(CONVERTER_Free, {ob}) > >There's also a chance the free'er can be defined as a procedure instead of >a function. > Thanks Al, I've done that, and still get the failure "A machine-level exception occurred during execution of this statement" I've also tried changing CONVERTER_Free to a procedure. Time to ask the DLL owner, or any more thoughts from the Euphoria end? I'm using an evaluation copy of the DLL, so I don't know that the owner will want to put any effort into supporting me at this stage. If I can get it working, I'm quite happy to pay him for a licence. -- Craig