You need to create the object based on your 'myBusiness' class, not the original 'wwBusiness' class..
THIS.oBusiness = CREATEOBJECT("myBusiness")
- Mike McDonald
Software Design of Kentucky
dear Rick,
excuse me, but how I can subclass wwBusiness class?
I created a new PRG with changes to wwBusiness class:
#INCLUDE wconnect.hDEFINECLASS myBusiness AS wwBusinessPROCEDUREOpen ...
then I added in Main.prg:
SETPROCEDURETO myBusiness.prg ADDITIVE
however when I run
this.oBusiness = CREATEOBJECT("wwBusiness")this.oBusiness.Open(...)
I see the original wwBusiness Open method called, and not the one I modified.
Thank you for patience
Just sublcass wwBusiness and then use that as your base class for whatever business objects you create. Don't change wwBusiness.
+++ Rick ---
Dear Rick,
I would like, for example, to change Opend method of wwBusiness class, so what I have to do?
I UNDEFINE and DEFINE into WCONNECT_OVERRIDE.H file.
Do I write the new Open method in MyAppProcess.prg?
Open method is only a part of the wwBusiness class, so must I write the full wwBusiness class code in MyAppProcess as MyBusiness class?
Thank you very much for patience.
You should never modify the base classes as they WILL get overwritten in updates. Whenever possible subclass any Web COnnection classes and they use those sub-classes instead. Most Web Connection classes are defined in WCONNECT.h as #DEFINE statements. For example:
#DEFINE WWC_RESPONSE wwResponse#DEFINE WWC_RESPONSEFILE wwResponseFile#DEFINE WWC_RESPONSESTRING wwResponseStringNoBuffer#DEFINE WWC_RESPONSEASP wwASPResponse
To change any of those classes create your subclass and then add the following into WCONNECT_OVERRIDE.H:
#UNDEFINE WWC_REQUEST#DEFINE WWC_REQUEST myRequest #UNDEFINE WWC_WWPDF #DEFINE WWC_WWPDF wwXFRX
Then if you need to explicitly instantiate these classes use:
loPdf = CREATEOBJECT([WWC_WWPDF])
The #DEFINEs are important because they are used internally in Web Connection to instantiate objects used inside of the frameowrk where you can control the object creation. In MOST (but not all) places Web Connection uses the above syntax to create objects.
+++ Rick ---
Dear Rick,
by developing my new application sometime I have to customize original Classes: I comment original code, then I write my customized code.
However I fear that future upgrades could overwrite original Classes and so I could lose my customizations.
Please is there any better way to customize?
Thank you very much again for your great software and for your precious support!