Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Loading an .APP file from a VFP COM object
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Loading an .APP file from a VFP COM object
Miscellaneous
Thread ID:
01503828
Message ID:
01503828
Views:
194
So here's something that I thought should work but I can't get working for the life of me:

I have VFP COM server and I need to run a bunch of code that lives inside of another .APP file. Inside of the .APP file I have a loader program that basically does a bunch of SET PROCEDURE TO ADDITIVE to load up a bunch of libraries and then use the libraries in the VFP COM object.

Here's what I'm doing in the COM server:
FUNCTION Init()

*** Load configuration settings so we can dynamically 
*** create our 'real' Web Connection server
loConfig = GetConfigData()

*** Have to do this so VFP comiler doesn't pull in wconnect.prg into this project
*** This is the loader that does a bunch of SET PROCEDURE TO
lcCmd = "DO wconnect.prg in '" + loConfig.AppFileName + "'"

LogString(lcCmd)

*** THIS IS WHAT FAILS - WCONNECT.PRG NOT FOUND
*** loConfig.AppFileName is a full valid path to the .app file
&lcCmd

*** If I comment the above out - the NewObject() fires but then fails because 
*** it doesn't have the necessary dependencies for base classes etc.
*** This needs to have the SET PROCEDURE TO etc. loaded
this.oProxy = NEWOBJECT(loConfig.ServerClassName,loConfig.AppFileName)

ENDFUNC
I also tried just instantiating a class directly from the .APP file (the last line) and that works fine, except it fails because it's missing a bunch of references like its base class. I need to be able to SET PROCEDURE TO to get the class bootstrapped.

This fails for both EXE and DLL servers, but it works in the dev environment and if I run a plain EXE.
Am I going about this wrong, or does this just not work?

FWIW, the idea of this is that the COM object is a small front end proxy loader that loads up a more complex object that does all the actual work in the .APP file. The idea is that the COM interface that server sees never really changes and only the .APP file needs to be updated. Nice idea, but this failure is not helping me...

+++ Rick ---
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Next
Reply
Map
View

Click here to load this message in the networking platform