Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reducing size of a Large EXE
Message
From
20/05/1999 03:25:24
 
 
To
19/05/1999 11:40:35
Ernie Veniegas
Micro System Solutions, Inc.
Calistoga, California, United States
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00220088
Message ID:
00220714
Views:
18
Hi Ernie

Like nearly everything in Fox, the class libraries (vcxs) are just tables. Take a look by using and browsing your vcx files (USE {myclass}.VCX - you have to specify the .vcx extension). The VCTs are just the memo files.

You will notice that all the methods for each of the classes are stored in the methods field of the vcx. This is the code that is compiled and then stored in the objcode field which is the code that is actually executed. This is normally handled automatically, but you can force it to happen by issuing the command COMP CLASS {myclass}.

So, the strategy I normally follow before distributing an EXE without the VCX's is this.

Recompile all the classlibs COMP CLASS ...
Open/Use the VCX
Replace all methods with ""
close the VCX

Effectively, this removes the source code from the VCX, but keeps the comiled version. You can even automate this in a little routine. Remeber though, that you do need to keep the source code in your development environment, else you won't be able to develop in the future, so it's best to back up everything before doing this.

You can even take advantage of this by adding code automatically to some classes. Look at the following routing,

USE myclass.vcx
REPLACE ALL methods WITH "PROCEDURE DblClick" + CHR(13) + CHR(10) + ; "THISFORM.SortGrid(THIS)" + CHR(13) + CHR(10) + ;
"ENDPROC" + CHR(13) + CHR(10) ;
FOR class = "header" AND ;
"grdquerygrid" $ LOWER(parent) AND ;
EMPTY(methods)
USE
COMP CLASS myclass.vcx

This automatically adds a call in the DblClick event to sort the grid. Cool eh.

Anyway, got to go

Have fun

Mace
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform