How load custom VFP libraries in MAIN.PRG

Topics: Developer Forum
Jan 28, 2012 at 3:36 PM


I'am an experienced VFP programmer, but new to ActiveVFP. I'm trying to customize my MAIN.PRG in order to do some custom stuff, and I'm been trying unsucessfully to load a custom PRG library in MAIN.PRG.  

Is there any way for me to use a custom PRG o VCX library inside MAIN.PRG ?



Victor Espina

Jan 29, 2012 at 8:18 AM
Edited Jan 29, 2012 at 8:23 AM

Should be the same as regular VFP (because ths is regular VFP):

SET PROC to oProp.AppStartPath+'prg\pages' ADDITIVE   && Make sure you use ADDITIVE or bad things happen!
lcPages= pages(lnTotPerPage,lnpagenumbers,lnStart,lcButton,lnRowCount)


CreateObject ...


(if you don't want to lock the object in IIS memory)

lcRetVal = EXECSCRIPT(FILETOSTR(oProp.AppStartPath+'\prg\myexternalfunc.prg'))

** use this code in the scripts (.avfp or .htm) or main.prg or another .prg ...

Jan 30, 2012 at 2:35 PM

Thanks. The problem was that I hadn't compiled the PRG. Anyway, working with compiled code has the big problem that I had to restart the webserver in order to be able to recompile my library after every change to the library's source code, so I changed my approach to use EXECSCRIPT() and now its working perfectly,

Thanks for your help.


Victor Espina