Re: dll question ver 2.5

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

You could write some machine code to set up the stack frame then call the C
routine
bypassing the call to define_c_proc/define_c_func.

Alexander Toresson wrote:
> 
> Bernie Ryan wrote:
> > 
> > Larry Miller wrote:
> > > 
> > > It is possible to call a DLL function by it's ordinal, at least in 2.4.
> > > You get a handle to the DLL with GetModuleHandle and then use
> > > GetProcAddress
> > > to obtain the address of the desired DLL routine. The function is then 
> > > defined:
> > > 
> > > xxx=define_c_func("",address,{parameters},C_LONG)
> > > 
> > > This may not be entirely legitimate and may not work in all cases.
> > > 
> > > Larry Miller
> > > 
> > 
> > Thanks Larry.
> > 
> > What I don't understand is why RDS dosen't just simply
> > add that capability into define_c_function because I'am
> > sure they are using GetProcAddress when you use the name
> > of a function. if you look at define_c_function name in dll.e
> > it uses the parameter " object routine_name " which
> > could be passed a atom or a sequence.
> >  
> > 
> > Bernie
> > 
> 
> I don't really see the advantage of this. The programmer has to do a little
> less work
> when wrapping a dll, however, the code becomes a lot less readable and it
> depends on
> the functions coming in a specific order, which can cause much confusion.
> 
> Regards, Alexander Toresson
>

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

Search



Quick Links

User menu

Not signed in.

Misc Menu