Question

More of a direct answer for myself, and others who may be supporting legacy VFP apps using the _Crypt.vcx class library from Visual Foxpro.

I recently upgraded to a new Windows 7-64bit machine for development and had to support as described a legacy system. The _Crypt.vcx class is used for encryption/decryption. While running the app on the new machine, I had a problem getting / setting decryption values.

The failure was when trying to get a provider handle when calling the "CryptAcquireContext" during the class initialization.

For whatever reason, and I do not know why, there is a property on the class called

This.cContainerName

and from the "WinCrypt.h" file, if no value is provided for this property, it was getting set to "FOXPRO_APP". Again, for whatever reason, I don't know, but through debugging, I forced changing this value to anything else, such as just "Visual FoxPro", and the encryption worked.

That is the ONLY change I made, and it is now working in VFP on Windows 7 machines.

So, now, on that class, I have changed the default value to "Visual FoxPro" (or you could change in the header file) and it works.

Hope this helps anyone in the future.

Was it helpful?

Solution

Again, self-answered, hoping it helps anyone else on legacy support.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top