PDA

View Full Version : include code from compiled ppc files


Nicknack
10-14-2009, 09:18 PM
is this possible without the use of #include ? I know there a functions like run(),eval()..., but these only execute the extern code not adding the extern functions to current code for further use.
this would be useful to add additional plugins to an existing program, also plugins which are dynamic generated by users with an extra prog for that.
any ideas to accomplish this? :o

kornalius
10-15-2009, 05:15 AM
Just a quick note to let you know that I will be looking at this email and the others you've left tomorrow or Friday and give you answers.

Nicknack
10-15-2009, 08:55 AM
ok I can wait, only the solution for getobjproc has a bigger importance for my current project.

just one more little question to fill up this post: works LAddr in combination with spritedata? :D

kornalius
10-15-2009, 07:39 PM
A trick that might work:

Calling program:

a$ = Eval(AppPath$ + "plugin.ppc", -1);
linkapp(a$); // This is a new function just added in. unlinkapp() is also included.
test; // proc test is now available to current app. Classes are also available.
unlinkapp(a$); // unlink app procedures and classes.
killapp(a$); // kill plugin app from memory


Plugin.ppl:

forcelink proc test
end;

func winmain
return(true); // Make sure plugin app does not get freed from memory.
end;


LAddr():

l$ = Add(10, 20, 30, 40);
static(l$); // Makes the list stay in memory and not get deleted.
SetSpriteData(s$, laddr(l$));

Nicknack
10-16-2009, 02:38 PM
oh that sounds good, thanks again for all your answers!