Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Class in PRG vs class in VCX
Message
From
26/05/2021 18:10:50
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
01680487
Message ID:
01680748
Views:
133
>Hi,
>
>I am wondering if it is a better practice to have the class defined in a PRG file or VCX file? Note that I don't care about the speed. All I care is about how VFP uses the class. Let me explain what I mean by "uses" (because I don't know how).
>
>In my application there is a class PASSWORD defined in a PRG file. It has several methods and a number of properties. This class is instantiated at the top of the application and the reference is a PUBLIC variable oPassword. Again, it is not important that this is a public variable. I can easily make it into a property of the application object/class. But I think, at this point, it is not important.
>
>This class PASSWORD works for 99% of the customers without any problems. But I have a customer (I already have a couple of threads about issues the application has there) that has the following problem.
>
>Sometimes (rare but sometimes) when a method of the class PASSWORD is used (e.g. oPassword.passcode( ### ), the program bombs with the message "cannot find the file c:\users\.......\password.fxp"
>Interesting that at exactly the same time the application loses connection to the SQL Server (because I keep a log of these issues). But using the code suggested by Walter Meester, the SQL Server connection is restored ON THE FIRST trial. Which is great. But I don't know how to restore the application connection to the VM share where the application reside. Therefore, I have two questions:
>
>1. If the class PASSWORD is refactored into a VCX file, do you think it will be more stable?
>2. My understanding is that the entire application (it is about 17MB in size) is loaded into the PC memory when the application starts. Therefore, the application should not really "go back" to the VM share to get some code. Because the code is all inside the APPL.EXE file and therefore in the memory of the PC.
>What then "wipes" the code from the PC memory that the application needs to "go back" to the share?
>
>TIA.

The exe is not loaded completely into memory when the application starts. This speaks to the fact that having the exe on the workstation is better overall, despite the opinions of the less-informed. This has been told to people forever as a best practice, by myself and others but too many people prefer to ignore such advice.

Furthermore, MaxFrame had a utility to remove pathing from classes, screens etc, so it would not report folders that don't exist on the users' PC.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform