From: "Rafał Maj" Newsgroups: comp.os.msdos.djgpp Subject: Odp: calling functions Date: Wed, 16 Aug 2000 21:47:23 +0200 Organization: Academic Computer Center CYFRONET AGH Lines: 43 Message-ID: <8ner77$et8$2@info.cyf-kr.edu.pl> References: <8ndkeb$lt8$5 AT info DOT cyf-kr DOT edu DOT pl> <2950-Wed16Aug2000151610+0300-eliz AT is DOT elta DOT co DOT il> NNTP-Posting-Host: d-22-55.cyfronet.krakow.pl X-Trace: info.cyf-kr.edu.pl 966455335 15272 149.156.1.232 (16 Aug 2000 19:48:55 GMT) X-Complaints-To: news AT cyf-kr DOT edu DOT pl NNTP-Posting-Date: 16 Aug 2000 19:48:55 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Użytkownik Eli Zaretskii w wiadomości do grup dyskusyjnych napisał:2950-Wed16Aug2000151610+0300-eliz AT is DOT elta DOT co DOT il... > > From: "Rafal Maj" > > Newsgroups: comp.os.msdos.djgpp > > Date: Wed, 16 Aug 2000 10:44:44 +0200 > > > > long int size = ((long int)(void*)fun_end) - ((long int)(void*)fun); > > char *ptr = new char[size]; > > memcpy(ptr,(void*)fun,size); > > > > void (*function_ptr)() = (void (*)()) ptr; > > > > (*function_ptr)(); // <------ CALL of function copy > > This is not supposed to work. (...) > > Why would you want to do anything crazy like that, anyway? > I wanted to use small plug-ins, but now I think I should use DXE instead. Can someone send me a little example of DXE program, C++ program using DXE, and instruction how to compile/build it under RHIDE ? __PLEASE__ can You write few lines of example, not just tell me to read DOCs... What are restrictions of DXE program ? > Copy the code from Allegro more faithfully, and it will work for you > as well. I cann't beacause this part of Allegro is written in assembler and it is very hard for me to use it in my program. Allegro doesn't exacly call copy of function code stored in memory, but it calls it's own, real-time-compiled code, that is written in assembler. But it doesn't real matters, I will use DXE... Rafal