Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parent class inside exe, subclass in subfolder
Message
From
19/10/2018 16:58:06
 
 
To
19/10/2018 11:08:29
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2008 R2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01662676
Message ID:
01662687
Views:
81
>I'm losing hair for three days now over this problem. Here's the layout of it:

I remember typing with my forehead long time ago on a similar problem:
customer of large parent exe has 2 apps compiled into 2 different apps oWW.app and oHH.app.
Both apps utilize common classes found in multirisk.vcx as ParentClasses.
In first releases multirisk.vcx was included in oWW.pjx and oHH.pjx, resulting in duplicate code being installed at all sides where both apps were installed.
In optimizing maintainance about 2 years later DRY even on rollout was specced, as the previous way of doing things also utilized duplicte loading time for multirisk.vcx and memory space.
As some installs had neither oWW.app nor oHH.app compilng multirisk.vcx into exe was not an option. Optimized solution was to exclude multirisk.vcx from oWW.pjx and oHH.vcx and create new oMultirisk.app with multirisk.vcx included.

Loading either oWW.App or oHH.App was done via special method, which

1) put oMultirisk on the program stack
2) called a tiny function ***inside oMultirisk.app*** adding multirisk.vcx via set libr
3) called via parameter starting function in oWW.app or oHH.app from Multirisk.app

(confidence of my own memory only 80% of that including ALL necessary steps)
Remember the times when only single "other" prg could be "referenced" in FPD?
Utilizing the "search for program name" in already loaded memory meant that you load the "helper functions" onto the program stack and if later called from own code the runtime searched up the stack to find program name - similar principle, with some more twists like "do in xxx.app" with tcparameter

;-)))

Gimme feedback if it works so I can reschedule Alzheimer diagnostic visits to later times ;-)

HTH

thomas


>
>I have to have a replaceable module, which would simply be a bunch of files (vcx, prg, dbf) in a subfolder, so that any updates can be done independently from the main exe. The plan is to actually have the users get the latest from the web, just unzip to this folder (all can be automated, just like other similar cases), but...
>
>The parent classes of the classes in those classlibs are inside the exe. The relative paths to these parent classes are pointing to those inside the main exe, e.g. if there's a classlib called libs\main\blabla.vcx, its subclass in the addon\subbla.vcx has ..\libs\blabla.vcx in its classloc memo. But it won't find it - it says "libs\main\blabla.vcx does not exist". I even tried removing path from classloc in subbla.vcx, tried explicitly opening the classlib inside the exe, tried creating an object based on a class from it, nothing works.
>
>How do I tell it to find the vcx inside the exe?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform