[fpc-pascal] assign code to a method

Jonas Maebe jonas.maebe at elis.ugent.be
Fri Feb 18 11:47:35 CET 2011


On 18 Feb 2011, at 09:14, Angel Montesinos wrote:

> I have tried all possible combinations like V:= PChar(code), V:=  
> @code[1], etc. to no avail. Thus I think something is wrong in my  
> understanding of the whole business in 64 bits or in fpc-Lazarus,  
> because this is not a problem in Delphi nor it was in an old version  
> of fpc-Lazarus 32 bits. Please give me a tip.
> Many thanks in advance.

You probably have to mark the memory in which you write the code as  
"executable" first (this has to be done using an OS-specific function;  
I know next to nothing about Windows programming, but you should be  
able to find the necessary information in MSDN).

In fact, you should also do this on 32 bit platforms, since more and  
more systems mark memory by default as not executable for security  
purposes.


Jonas

PS: you should mention that you are not subscribed to the mailing list  
in all messages you send, because otherwise people won't know that  
they have to CC you when replying to your messages (I know only  
because I'm the list admin and let your message through when it was  
stuck in the moderation queue).




More information about the fpc-pascal mailing list