I solved the previous issue (replace the function with a procedure) but here is where I am stuck now.
To review: I'm trying to use vfp 9.0 COM objects plus htmllistener to produce asp pages on the fly. As was suggested "repo form" can not be used in a mtdll but does work in a com/exe which you can then call from the mtdll to exectute the "repo form" command.
I want my asp page to call my vfp/com/mtdll which calls a procedure (can't be a function) in my vfp/com/exe which executes the htmllistener process to output a report as html to a temp file. In the exe procedure I use filetostr() to put the whole html page into a string which is then returned to the mtdll which also returns it up the line as a string.
If I create the mtdll from the vfp control window this works great. I can get the whole html page as a string.
If I try and create the mtdll in an asp page the mtdll instantiates ok (I can return "hello world" from the mtdll for example) but when the mtdll tries to instantiate the com/exe I get "Message: OLE error code 0x80070005: Access is denied."
I have made sure iusr_machinename has all priviledges for both the exe and dll.
Help...What am I missing?